Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all.
I have this data
Vendedor | Valor |
A | 10 |
B | 10 |
C | 15 |
D | 20 |
E | 30 |
F | 40 |
And one aditional field named Val, with values:
Val |
---|
10 |
20 |
30 |
I have a straight table with one calculated dimension
If(Aggr(Sum(Valor),Vendedor)<=Val,Vendedor)
And one simple expression
Sum(Valor)
The idea is that the results are displayed depending on the selection on Val field. But where such selection is made, the results are not as expected. for example, when the value is 20.
But, if change the dimension to a hard-coded value, e.g. If(Aggr(Sum(Valor),Vendedor)<=20,Vendedor), it works fine.
Any suggestions?
Thanks in advance.
Julian
Try this as your calculated dimension:
If(Aggr(Sum(Valor),Vendedor) <= Aggr(Only(Val), Vendedor), Vendedor)
Try this as your calculated dimension:
If(Aggr(Sum(Valor),Vendedor) <= Aggr(Only(Val), Vendedor), Vendedor)
another option is using min/max, that one regardless if you have a selection or not it will always give you a default value
If(Aggr(Sum(Valor),Vendedor) <= Aggr(min(Val), Vendedor), Vendedor) |
Great!!!
Thank you so much.
No Problem
I am glad we were able to help.
Best,
Sunny
Thanks in advance Ramon!