Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
cedriclupo@ all,
I am facing some problems when calculating a TOTAL expression:
The problems is focus on one Dimension "Answer", which has two values, Yes and No.
I want my expressions, to be calculating regarding the Yes Answers, but when I have to calculate an Expression called Total Answers, this has to take into account the total Answers (Yes and No) so when I put a total in my expression, the No answer in the dimension appears, and I do not want this value of the dimension to appear.
The actual expression for this total answers that I have already is the following one:
sum( TOTAL<Question, store,date, $(= GetCurrentField(TotalStores))>
aggr(count( Answer),store,date $(= GetCurrentField(TotalStores)),Question, Answer))
Could some one advice me about how to do this total taking into accoun the "NO" Answers but in the dimension this value not to appear?
You can find an example of the output I would like to get without the No value of the dimension to appear.
Thanks in advance
Hi Beatriz, you can try using a different expression for totals, in example:
If (Dimensionality>0, Kaushik'sExpression, YourCurrentExpression)
So row by row it uses Kaushik's expression to show only YES values, for totals use your current expression which uses YES and NO
Hi,
Try this
sum( {<Answer = {"YES"}>}TOTAL<Question, store,date, $(= GetCurrentField(TotalStores))>
aggr(count( Answer),store,date $(= GetCurrentField(TotalStores)),Question, Answer))
Regards,
Kaushik Solanki
Hello! Thanks for your answer,
However, if I include that restrinction, the total only shows the totals regarding the Yes responses and I want to have the totals of Yes and No.
Hi,
Can you share the qvw file with sample.
Regards,
Kaushik Solanki
Hi Beatriz, you can try using a different expression for totals, in example:
If (Dimensionality>0, Kaushik'sExpression, YourCurrentExpression)
So row by row it uses Kaushik's expression to show only YES values, for totals use your current expression which uses YES and NO
Hello Ruben,
Effectively using an If has solved my problem, I wanted to know if there could be another options instead of using an "If",
Hi Beatriz, come to my mind different options (using Pick(), an extra field...) but all based in a check, so it will be similar that use an 'If', if it needs to avoid 'YES' in row but count them in TOTALS this will need a way to decide when count 'YES' or not.
Maybe some other user has a better idea to do this. As a crazy idea you can add a upper level with 3 options:
-YES: related with YES
-NO: related with NO
-TOTAL: related with YES and NO
Sorted by load order. Anyway if it was me I will prefer to go with the 'If' that trying this.
Please mark Kaushik's answer at least as 'Helpful', I feel like I stole his answer.
Thanks!! Both gave me correct aswers! But I can only select one
Hi Ruben,
You didnt steal anything.
And post should be marked as answered which gives exact answer. Because it helps others with similar problem to get exact answer.
Regards,
Kaushik Solanki