Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey people,
I have got a question concerning the if-expression.
Let me tell you what I am using in my formula:
Dimension "group" with 5 values = group1, group2, group3, group4, group5
Each group consists of different articles with different values:
eg.
group1 : article 1 (value = kilogram), article 2 (value = pieces)
group2 : article 1 (value = kilogram)
group3 : article 1 (value = pieces), article 2 (value = bags)
Different values need different calculations:
if the value = kilogram I use sum(Kilogram)
if the value = anything else I use sum(Revenue)
The formule I am using works fine:
if( value = 'bags' or value = 'pieces', sum(Revenue), sum(Kilogram))
Problem: I only want to show group1, 2 and 3 (without having to select anything).
So I guess somewhere I will have to write: Group = {'group1, group2, group3'}
AND, I also need the subtotal of the different groups. So somewhere in the dimension tab I should use a aggr() I assume..?
Thanks a lot!
May be like this
Sum({<value={'kilogram'}>}Kilogram) + Sum({<value-={'kilogram'}>} Revenue)
Hope it helps
Celambarasan
Hi,
You can add calculated dimension and write the following script.
if( wildmatch(Group,'group1', 'group2', 'group3'),Group)
Hope this will help.
-Nilesh
This one works just fine already. That's awesome thanks!
Just one small question though, it also gives me a 4th group called ' - ' and this is the sum of the groups 4 and 5.
How can I hide this 4th one?
Hi
TRY LIKE THIS
Properties->dimension -> tick the Suppress when value is null option
May be like this
Sum({<value={'kilogram'}>}Kilogram) + Sum({<value-={'kilogram'}>} Revenue)
Hope it helps
Celambarasan
Thanks this worked!
Problem:
I should be using an aggr() somewhere, the subtotals are incorrect. How do I solve this?
Thanks!
It works!! Thanks a lot man!
I used it in combination with the wildmatch in my dimension and it now does exactly what it should do
Works like a charm!