Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
RenzoSbu
Contributor
Contributor

Create a Dimension the varies according to the value of a variable

Hi, I would like to create a dimension that varies according to the date that I put in a variable.

I have in a Dimension the entrance date, and in another dimension the exit date. I would like to create a calculated dimension that marks as "present" in a certain date (the Variable_A)  all the people entered before the date in the variable and that has exit after that date.

The following formula works only when I load the data , with the preset value of the Variable_A, but the dimension does not change when I modify the  value of Variable_A by a variable input Object on the dashboard: 

=IF(Date(Variable_A)>Date(ENTER_DATE) AND Date(Variable_A)<Date(EXIT_DATE]),'PRESENT','ABSENT')

Can you pls help me. Many Thanks. 

Labels (1)
1 Reply
Digvijay_Singh

It works fine if you treat it as a measure, any reason you would want it as dimension?

If you need it as a dimension, you may need below change - 

=IF(Date('$(Variable_A)')>Date(ENTER_DATE) AND Date('$(Variable_A)')< Date([EXIT_DATE]),'PRESENT','ABSENT')

See the attached app where I have added it as a measure and dimension both. Frankly I am not sure why it reacts differently 🙂