Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Mike8
Contributor II
Contributor II

Table chart not refreshing following variable value change

Hi. I have several table charts that display data based on a variable value in a calculated dimension, eg:

=if([Manager ID] = vUserPersonnelNumber, [Personnel Number])

If I change the variable value all charts automatically update to calculate with the new variable value. Except for one chart. I can't figure out why it is not updating like the others. The If statement is formulated in the same way. Is there a setting I can check that enables auto-refresh or something?

If I refresh the browser the chart reloads to display correctly. So it is calculating fine, it just will not refresh after I change the variable value, even though the others will.

Thanks!

Labels (1)
2 Solutions

Accepted Solutions
JHuis
Creator III
Creator III

Try this:

=if([Manager ID] = $(vUserPersonnelNumber), [Personnel Number])

View solution in original post

JHuis
Creator III
Creator III

Dear Mike,

Its an indication to the qlik engine resolve the expression between the $() , replace with the resulting values, before evaluating the expression. 

https://community.qlik.com/t5/Qlik-Design-Blog/The-Magic-of-Dollar-Expansions/ba-p/1471979

 

I hope this helps?

 

Is it best practice to always use $() with variables in expressions?

 

Yes., but it depends in the situation. I use variables more to make a filter on date or variabel input. So then you always need the $()

View solution in original post

4 Replies
JHuis
Creator III
Creator III

Try this:

=if([Manager ID] = $(vUserPersonnelNumber), [Personnel Number])

Mike8
Contributor II
Contributor II
Author

Thanks, the $() makes the chart refresh, fixing this issue. But can anyone explain why this is not required on some other charts that refresh automatically?

Here are the full dimension expressions for two table charts. One has $() and the other does not, but both refresh automatically. When the $() is taken out that chart will not refresh after a vUserPersonnelNumber variable value change, but the other charts will refresh.

=if([Event Date]>=today()-14
and ( [Event Manager ID] = $(vUserPersonnelNumber) or ($(vDirectReports)=0 and [Event Senior Manager ID] = $(vUserPersonnelNumber)) )
,[Event Date])

 

=if ( [Employment Status] = 'Active'
and [Action Start Date] <= today()
and [Action End Date] >= today()
and ([%Manager ID] = vUserPersonnelNumber or (vDirectReports=0 and [%Senior Manager ID] = vUserPersonnelNumber))
and [Position Start Date] <= today()
and [Position End Date] >= today()
and [CC From Date] <= today()
and [CC To Date] >= today()
, [%Personnel Number])

 

Is it best practice to always use $() with variables in expressions?

JHuis
Creator III
Creator III

Dear Mike,

Its an indication to the qlik engine resolve the expression between the $() , replace with the resulting values, before evaluating the expression. 

https://community.qlik.com/t5/Qlik-Design-Blog/The-Magic-of-Dollar-Expansions/ba-p/1471979

 

I hope this helps?

 

Is it best practice to always use $() with variables in expressions?

 

Yes., but it depends in the situation. I use variables more to make a filter on date or variabel input. So then you always need the $()

Mike8
Contributor II
Contributor II
Author

Thank you for your help!