Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
GeorgeEard
Contributor II
Contributor II

How to change Today() to a date you can select

I am trying to find out the amount of orders there were at a certain point in time

I have a dimension:

=If([Orders Order Date] < Today(), '1',

If([Contract Transfer Date] > today(), '1',

If([Contract Transfer Date] >= '-', '1', '0')))

I am currently using this which works but only for today. How could i change this so that any date in time could be selected and we could see how many orders we had at that time?

Thank you

Labels (1)
5 Replies
PrashantSangle

you can store your selected date in variable & use that variable instead of Today

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
F_B
Specialist
Specialist

Hi @GeorgeEard , welcome to the community!

 

You can create a variable in the load editor and set it as today by default:

LET vDate=Today();

 

In your dimension substitute Today() with the variable:

If([Orders Order Date] < $(vDate), '1',

If([Contract Transfer Date] > $(vDate), '1',

If([Contract Transfer Date] >= '-', '1', '0')))

 

With a variable input in your sheet you can then choose a different date.

GeorgeEard
Contributor II
Contributor II
Author

Thank you for your reply,

How would i do that?

 

GeorgeEard
Contributor II
Contributor II
Author

Could I use the date picker to influence this variable?

PrashantSangle

yes you can. considering your date field name is cal_date

then try below

If([Orders Order Date] < date(max(cal_date)), '1',

If([Contract Transfer Date] > date(max(cal_date)), '1',

If([Contract Transfer Date] >= '-', '1', '0')))

 

check you date format while comparing or convert them in num then use it.

 

Regards,

Prashant Sangle

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂