Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
julian_ortiz
Partner - Contributor III
Partner - Contributor III

Show dimension and expression by a field value

Hi all.

I have this data

  

VendedorValor
A10
B10
C15
D20
E30
F40

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

1 Solution

Accepted Solutions
sunny_talwar

Try this as your calculated dimension:

If(Aggr(Sum(Valor),Vendedor) <= Aggr(Only(Val), Vendedor), Vendedor)

View solution in original post

5 Replies
sunny_talwar

Try this as your calculated dimension:

If(Aggr(Sum(Valor),Vendedor) <= Aggr(Only(Val), Vendedor), Vendedor)

ramoncova06
Specialist III
Specialist III

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)
julian_ortiz
Partner - Contributor III
Partner - Contributor III
Author

Great!!!

Thank you so much.

sunny_talwar

No Problem

I am glad we were able to help.

Best,

Sunny

julian_ortiz
Partner - Contributor III
Partner - Contributor III
Author

Thanks in advance Ramon!