Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
DMG
Contributor III
Contributor III

Variables in Expression issue

 

Hi i have a variable (var_unit) set in the load statement, and then a series of buttons set to change the value of the var_unit.

Inside my table, in one of the fields i have the following expression

=if((PrimaryEntity=var_unit),Title,null())

Basically, if the primary entity in a row equals the variable, then display the title, else null, and then i hide the nulls.

This works fine if i use

=if((PrimaryEntity='unit name'),Title,null())

But not when i replace 'unit name' with var_unit, in those cases it always uses the default value for the variable set in the load statement.

Elsewhere in the form, i have several "title" fields and text boxes, and these all change fine to reflect the new variable value when i press one of the buttons linked to a set variable action, but the actual field expression doesnt.

Any ideas ? (for reference i'm using the vizlib extension table rather than the core qlik object, so i guess it could be a bug with that if my code is correct)

???

 

 

1 Solution

Accepted Solutions
Kushal_Chawda

@DMG  try below

=if((PrimaryEntity= '$(var_unit)'),Title,null())

View solution in original post

2 Replies
Kushal_Chawda

@DMG  try below

=if((PrimaryEntity= '$(var_unit)'),Title,null())

DMG
Contributor III
Contributor III
Author

Perfect thanks