Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Suppose I have a straight table with three dimensions and one expression, and the expression has nested If statement along with Fractile() function.
When I select second row i.e. Test1, the value in the Metric is changing.
Our requirement is the Metric value should not change even if user selects any row in the straight table. Is there is any way, that I can get the previous value of the expression. I have tried Previous() and Only() function, but as the expression has nested If statements, the application hangs.
Waiting for inputs.
Thanks & Regards,
MK
Try this formula:
=if((C+B) <= fractile({<Name = , B = , C = >}TOTAL aggr((Only({<Name = , B = , C = >}C)+Only({<Name = , B = , C = >}B)),Name), 0.1), 10,
if((C+B) <= fractile({<Name = , B = , C = >}TOTAL aggr((Only({<Name = , B = , C = >}C)+Only({<Name = , B = , C = >}B)),Name), 0.2), 12,
if((C+B) <= fractile({<Name = , B = , C = >}TOTAL aggr((Only({<Name = , B = , C = >}C)+Only({<Name = , B = , C = >}B)),Name), 0.3), 14,
if((C+B) <= fractile({<Name = , B = , C = >}TOTAL aggr((Only({<Name = , B = , C = >}C)+Only({<Name = , B = , C = >}B)),Name), 0.4), 16,
if((C+B) <= fractile({<Name = , B = , C = >}TOTAL aggr((Only({<Name = , B = , C = >}C)+Only({<Name = , B = , C = >}B)),Name), 0.5), 18,
if((C+B) <= fractile({<Name = , B = , C = >}TOTAL aggr((Only({<Name = , B = , C = >}C)+Only({<Name = , B = , C = >}B)),Name), 0.6), 20,
if((C+B) <= fractile({<Name = , B = , C = >}TOTAL aggr((Only({<Name = , B = , C = >}C)+Only({<Name = , B = , C = >}B)),Name), 0.7), 22,
if((C+B) <= fractile({<Name = , B = , C = >}TOTAL aggr((Only({<Name = , B = , C = >}C)+Only({<Name = , B = , C = >}B)),Name), 0.8), 24,
if((C+B) <= fractile({<Name = , B = , C = >}TOTAL aggr((Only({<Name = , B = , C = >}C)+Only({<Name = , B = , C = >}B)),Name), 0.9), 26,
if((C+B) <= fractile({<Name = , B = , C = >}TOTAL aggr((Only({<Name = , B = , C = >}C)+Only({<Name = , B = , C = >}B)),Name), 1.0), 28, 8))))))))))
What exactly the expression looks like? Would you be able to share that, because without looking at the expression, it would be hard to give any suggestions.
Best,
Sunny
When you select a row in a chart\table, you select corresponding values in the dimension(s). If you want this to have no effect on your calculations you need set analysis (see help). In this case that would be something like (example)
Sum({<Name,B,C>} Sales)
This disregards the selections in Name,B and C fields
Thanks for the quick response sunindia,
The expression looks somewhat like -
=if(($(v1)+ $(v2)) <= fractile(TOTAL aggr(($(v1)+$(v2)
),dimenaion1), 0.1), 10,
if(($(v1)+$(v2)) <= fractile(TOTAL aggr(($(v1)+$(v2)
),dimenaion1), 0.2), 12,
if(($(v1)+$(v2)) <= fractile(TOTAL aggr(($(v1)+$(v2)
),dimenaion1), 0.3), 14,
if(($(v1)+$(v2)) <= fractile(TOTAL aggr(($(v1)+$(v2)
),dimenaion1), 0.4), 16,
if(($(v1)+$(v2)) <= fractile(TOTAL aggr(($(v1)+$(v2)
),dimenaion1), 0.5), 18,
if(($(v1)+$(v2)) <= fractile(TOTAL aggr(($(v1)+$(v2)
),dimenaion1), 0.6), 20,
if(($(v1)+$(v2)) <= fractile(TOTAL aggr(($(v1)+$(v2)
),dimenaion1), 0.7), 22,
if(($(v1)+$(v2)) <= fractile(TOTAL aggr(($(v1)+$(v2)
),dimenaion1), 0.8), 24,
if(($(v1)+$(v2)) <= fractile(TOTAL aggr(($(v1)+$(v2)
),dimenaion1), 0.9), 26,
if(($(v1)+$(v2)) <= fractile(TOTAL aggr(($(v1)+$(v2)
),dimenaion1), 1.0),28, 8 ))))))))))
Thus, when I select only one row, by default the value becomes 10.
Please assist.
Thanks & Regards,
MK
Share QVW file
Try this:
The expression looks somewhat like -
=if(($(v1)+ $(v2)) <= fractile({<Name = , B = , C =>}TOTAL aggr(($(v1)+$(v2)
),dimenaion1), 0.1), 10,
if(($(v1)+$(v2)) <= fractile({<Name = , B = , C =>}TOTAL aggr(($(v1)+$(v2)
),dimenaion1), 0.2), 12,
if(($(v1)+$(v2)) <= fractile({<Name = , B = , C =>}TOTAL aggr(($(v1)+$(v2)
),dimenaion1), 0.3), 14,
if(($(v1)+$(v2)) <= fractile({<Name = , B = , C =>}TOTAL aggr(($(v1)+$(v2)
),dimenaion1), 0.4), 16,
if(($(v1)+$(v2)) <= fractile({<Name = , B = , C =>}TOTAL aggr(($(v1)+$(v2)
),dimenaion1), 0.5), 18,
if(($(v1)+$(v2)) <= fractile({<Name = , B = , C =>}TOTAL aggr(($(v1)+$(v2)
),dimenaion1), 0.6), 20,
if(($(v1)+$(v2)) <= fractile({<Name = , B = , C =>}TOTAL aggr(($(v1)+$(v2)
),dimenaion1), 0.7), 22,
if(($(v1)+$(v2)) <= fractile({<Name = , B = , C =>}TOTAL aggr(($(v1)+$(v2)
),dimenaion1), 0.8), 24,
if(($(v1)+$(v2)) <= fractile({<Name = , B = , C =>}TOTAL aggr(($(v1)+$(v2)
),dimenaion1), 0.9), 26,
if(($(v1)+$(v2)) <= fractile({<Name = , B = , C =>}TOTAL aggr(($(v1)+$(v2)
),dimenaion1), 1.0),28, 8 ))))))))))
Best,
Sunny
I tried with your expression, but no luck.
The Metric is depending on the Name dimension, in that case, I cant ignore that as well.
Please assist.
Tried this way, as well, no luck.
It's not ignoring the Dimension, it's ignoring selections in the dimensions. See also Sunny's answer
Then probably whatever is in $(v1)+$(v2) is also affected by the selection, use the same set analysis in these as well. Otherwise share your qvw