on 07-07-2016 7:49 PM
Hello everybody,
I am new to this forum, maybe somebody can help me
At it's core, I want to create a calculation view that calculates count() of different values for one column
in SQL, I was able to solve the problem with the following code:
SELECT "Id", count(case when "TA_TYPE"='StrongPositiveSentiment' then 1 end) as "SPS",
count(case when "TA_TYPE"='WeakPositiveSentiment' then 1 end) as "WPS",
count(case when "TA_TYPE"='Sentiment' then 1 end) as "S",
count(case when "TA_TYPE"='WeakNegativeSentiment' then 1 end) as "WNS",
count(case when "TA_TYPE"='StrongNegativeSentiment' then 1 end) as "SNS"
FROM "GBI_011"."$TA_GRUPPE_3_ENGLISH_IDX"
GROUP BY "Id"
The corresponding output looks like this:
Now, I want to create the same in a calculation view with SQLScript, but it seems the same code doesnt work there. I want to group by "Id" and get the count() values for different entries in "TA_TYPE", e.g Sentiment, WeakPositiveSentiment etc... in the calculation view
any suggestions? I hope I made my problem clear
Greetings
Daniel
Hi Daniel,
What you mean by 'it seems the same code doesn't work there'? I can't see why it wouldn't work but is there any error message you're facing?
Maybe post your actual sqlscript code so we can look at it. If you have some small sample data that helps even further.
BRs,
Lucas de Oliveira
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
10 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.