Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
Imagining that i have a field called "Flag" and 3 distinct text values:
Candidate
Incumbent
No Incumbent
I need to count the total number of occurrences of "Incumbent" and "No incumbent", and not count the total number of Candidates from the field "Flag".
If i use count (Flag), i will have the total ocurrences of the 3 values, but i jus want the total of "Incumbent" + "No Incumbent".
I don´t know how to do that, once i am counting text values.
Thanks,
Rodrigo
COUNT({<Flag = {"Incumbent","No Incumbent"}>}Flag)
COUNT({<Flag = {'Incumbent','No Incumbent'}>}Flag)
count({<Flag={"Incumbent","No Incumbent"}>} Flag)
OR
if(Flag="Candidate", null(), Count(Flag))
COUNT({<Flag = {"Incumbent","No Incumbent"}>}Flag)
try this -
=Count(if(Flag = 'Incumbent' or Flag = 'No Incumbent',Flag))
Thanks for your answer guys!!
I am not sure where do i have to include the script COUNT({<Flag = {"Incumbent","No Incumbent"}>}Flag).
In the chart expression?
Inside the table script?
In the calculated dimension?
Set analysis are expressions to be evaluated in graphs, lists, variables and other objects, never at script level.
You should use it where you want to see that value, a text box for example
COUNT({<Flag = {"Incumbent","No Incumbent"}>}Flag) / COUNT(TOTAL {<Flag = {"Incumbent","No Incumbent"}>}Flag)
OK, now i have another situation...
I need to create a chart that shows the gender percentage of people that are only "Incumbent" and "No Incumbent".
So i have to use the dimension "Gender" and use the same expression used above?
Thanks!