Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How can I Show the Count as a Text on a Bar Chart. My expression is
if((NumberYes/NumberQuestions)<0.858,(NumberYes/NumberQuestions))
I am getting the right number of Bars for example I have 36 Bars.
I wanna display the 36 as a Text box somewhere on the Bar Chart.
I have tried the Followung expression in the Presentation Tab->Text in chart and it works only if you select a Bar. Any Ideas??
if((NumberYes/NumberQuestions)<0.858,Count(Total DISTINCT location_id))
Try this:
count(distinct if(aggr((NumberYes/NumberQuestions), location_id)<0.858, location_id))
Hope this helps!
in presentation -> text in chart, insert your expression then press ok
now press shift +ctrl and move the text where you need
Already Tried that
Hi Ray,
what is your dimension of the chart. Lets call it Dim.
Then this should work:
. . ., Aggr(Count(Total DISTINCT location_id), Dim) )
RR
It works better,atleast I am getting the number now, but I need the count with a condition like below
if((NumberYes/NumberQuestions)<0.858,Count(Total DISTINCT location_id))
Try this:
count(distinct if(aggr((NumberYes/NumberQuestions), location_id)<0.858, location_id))
Hope this helps!
Try this...
if((NumberYes/NumberQuestions)<0.858,Count(DISTINCT location_id))
I would have thought the issue is that there is no aggregation on the two values in the division, should it not be something like:
if((sum(NumberYes)/sum(NumberQuestions))<0.858,Count(DISTINCT location_id))
Previously without a single bar selected there would have been multiple values for each of those figures and so they would have been returning NULL.
Steve
That works, now one more question, The numer 0.858 in the above expression is a Hard coded number I wanna replace it with AVG(NumberYes/NumberQuestions).
I know we cant do the Avg under Aggr
I would put it in a variable and refer to it in your expression.
Create a variable vAvgQuestions, with the content:
=AVG(NumberYes/NumberQuestions)
You can then use it in your expression like this:
count(distinct if(aggr((NumberYes/NumberQuestions), location_id)<$(vAvgQuestions), location_id))
I think I missed your initial question, are you trying to count how many bars are under the average?
Cheers
Steve