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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Mark18
Contributor II
Contributor II

Changing variable value based on other variable

Hello guys,

I have two variables vFilter which stores the name of a field (column) i have a variable vMax which should change if the vFilter variable changes.

For example,

Initially vFilter value will be joinDate (column in table). The vMax value would be max(joinDate). Based on drop-down selection vFilter value will change to leaveDate( column in table). Now i want the vMax value to be changed to max(leaveDate).

Is this scenario possible? Please help

Thanks in advance

 

 

Labels (1)
4 Replies
edwin
Master II
Master II

try using 

=max($(vFilter))

as the definition of vMax

edwin
Master II
Master II

you need to be careful though with dual fields.  for date fields you will want Date(max(FIELD)) instead of just max(FIELD)

Mark18
Contributor II
Contributor II
Author

Hi Edwin,

Thanks its working but im facing another issue. The requirement now is there should be a drop-down which will show options like month and year. And there should be one more drop-down to select from value. The chart should start only from vFrom value.

I have used concat($(vFilter),'|') as expression for From drop-down. It is working.

But the problem is if i change the filter value from month to year. The drop-down options for from(drop down) is changing but it is not setting to the min of vFilter instead the value remains the last selected value (which is month). How can i solve this issue.

Hope this explains the problem.

Thanks

 

edwin
Master II
Master II

that sounds like a diff challenge and im sure a moderator will ask you to start a new topic.  it sounds a bit complicated and you may want to supply a QVW for someone to understand it.  definitely start a new topic