Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
VC1258
Contributor III
Contributor III

different variable formula based on a field selection

Hi All,

 

I am have 2 different variables, each one has a different formula:

ValueSelected = count(distinct if([FieldSelected]='X',0))

Variable1 = [MyField1]+[myField2]-[myField3] e.g. [10] + [5] - [1] = 14

Variable2= Money(Alt(Sum([myField]), 0)) 

 

When the user selects a specific value, I need it to go to variable 1, if not, then variable 2.

 

This is what I have been trying so far but it hasn't worked:

=if([ValueSelected] = 1, $(Variable2),$(Variable1))

How can I do this?

 

Labels (1)
1 Reply
Digvijay_Singh

Can  you elaborate further what is 'ValueSelected', is it a filterbox object expression where you are making selection?

Why variable1 fields are not surrounded by aggregation function like you got for variable 2?