Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Kaushik2020
Creator III
Creator III

Expressions for Variable not saved

Hi All,

I am calling a variable in a Straight table and in a Pivot Table. Pls refer below expression,

if(match( Avg(Aggr(Sum({$<Year=, Month=, Day=,
Date={">=$(=date(monthstart(max(Date))))<=$(=date(max(Date)))"}>}
Value),Code, Id), -1, -2) and Rank(total Num(Avg(Aggr(Sum({$<Year=, Month=, Day=,
Date={">=$(=date(monthstart(max(Date))))<=$(=date(max(Date)))"}>}
Value),Code, Id),'#,##0%')<=10, 2, Avg(Aggr(Sum({$<Year=, Month=, Day=,
Date={">=$(=date(monthstart(max(Date))))<=$(=date(max(Date)))"}>}
Value),Code, Id))

This variable converts the value from 0 and 1 to 2... for the top 10 records for the condition. I have noticed below conditions:

1. It is not saving and still the value is showing as 0 and 1 instead of 2. 

2. If i add '=' in front of the expression, it is showing as -2 for all the values instead of 2. 

Pls note, i am using Qlik Sense Desktop. November 2024 version.

Thanks in advance.

4 Replies
rubenmarin

Hi, you can add the expression to a pivot table without label and check if the $-expansion is converted as you want, oyu can also copy from that label and paste as new expression to check what is not working.

Note that if the table has some date fields as dimension it will not affect the $-expansion, as it is expanded before the table calculations, so if you ahve a table with year dimension and values from 2020 to 2025, the min date will be 1/1/2020 for all the rows and the max date will be 31/12/2025 for all the rows.

Kaushik2020
Creator III
Creator III
Author

Thanks for the reply, with just the complete expression in a table is working fine. but calling it via variable is not working. if i add a space in the expression and then call the variable, it works. But after sometime it gets reset. 

Pls note, i do not have any date or Date related parameters. in the table. Just Id and Code as Dimension.

rubenmarin

Hi, sorry but "not working" is not enough info, what's exactly not working? Nothing is converted? some values changes? That's why I asked to try "add the expression to a pivot table without label and check if the $-expansion is converted as you want", to get more info about what's really not working.

I also don't get what "after sometime it gets reset" really means. The expression in the stored variable changes? The values on table?

You can also upload a sample with dummy data just to check how it's used.

marina65
Contributor
Contributor

Hello,

Did you get this resolved?  I am having a very similar issue with the variables in my dashboard.  I updated the static comparison value in the variable, and this change is not reflected in the function expression that uses this variable in the chart. 

Any help would be greatly appreciated.