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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to change values of column based on variable box selections?

Hi,

I have a straight table with static column NOCHANGE with value 32. My user wants to show this value based on selections. when user made selection of dates for one month. I,e if date variable box is as below

StartDate= 01/01/2016

EndDate= 31/01/2016

then NOCHANGE column should show value as 128.

if date variable box is as below for a week

StartDate= 01/01/2016

EndDate= 07/01/2016

then NOCHANGE column should show value as 32.

Please can anyone suggest is it possible?

Thanks.


16 Replies
Not applicable
Author

EndDate= 31/01/2016 then vNOCHANGE = 128

EndDate= 07/01/2016 then vNOCHANGE = 32

where do I need to add the above two lines?

harsh44_bhatia
Creator
Creator

Hi,

Also it depends how you have defined. if assignment operator is used while defining, then simple reference to =vNOCHANGE will work otherwise

=$(vNOCHANGE)

Mark_Little
Luminary
Luminary

Hi,

if is it just that then you can add a variable

=IF(EndDate= '31/01/2016', 128,

      If(EndDate= '07/01/2016', 32))


Note the = sign

Then add the expression

vNOCHANGE

harsh44_bhatia
Creator
Creator

Hi,

under settings-->variable overview --> add

give variable name= vNOCHANGE

=if(EndDate='31/01/2016',128,if(EndDate= '07/01/2016',32))

in chart code expression

=vNOCHANGE

Not applicable
Author

Thanks. The dates I added in post is only for eg: month and week. how do I need to change the expression if it should pick selections of whatever user using?

Not applicable
Author

Thanks. only for these two dates '31/01/2016' and '07/01/2016' value is working fine in column.

what if user wants based on selection of dates?

how to change the expression?

Not applicable
Author

Thanks. only for these two dates '31/01/2016' and '07/01/2016' value is working fine in column.

what if user wants based on selection of dates?

how to change the expression?

I mean how to hard code the expression?