Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Change Today() to a different date

I created a dashboard for a client using stale data.  Many of the charts and calculations are based off of comparing Shipping and Ordering dates to the current date...today().  Is it possible to manipulate or change the date associated to today().

Thanks for you help.

1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

Hi,

Create a variable like below

vDate = Date(Today() - N)    ///(N may be any number you want to adjust)

Now use this variable wherever you are using Today(), this way you can in one place and it reflects in multiple places.

Today() will always return the system date of your computer, if you want to change value of it you have to change date in your computer..

Hope this helps you.

Regards,

Jagan.

View solution in original post

7 Replies
Not applicable
Author

hi jeremy

can you please explain what you want to do with an example

Anonymous
Not applicable
Author

Hi,

you can try Date(Date(today(), 'DD/MM/YYYY')+<Number of days to add>, 'DD/MM/YYYY').


The above just adds the number to today. So if I have +14, this will add 14 days to today. ​You can also subtract this

jagan
Luminary Alumni
Luminary Alumni

Hi,

Create a variable like below

vDate = Date(Today() - N)    ///(N may be any number you want to adjust)

Now use this variable wherever you are using Today(), this way you can in one place and it reflects in multiple places.

Today() will always return the system date of your computer, if you want to change value of it you have to change date in your computer..

Hope this helps you.

Regards,

Jagan.

HirisH_V7
Master
Master

Hi,

Can you explain a bit more please with some sample if possible,

-Hirish

HirisH
“Aspire to Inspire before we Expire!”
Not applicable
Author

Jagan,

Thanks.  Yea I should have created a variable at the beginning of development and then performed all calculations based off of the variable.  The problem is I already coded everything based off of using today(). 

Yea i was just hoping that there was some way i would be able to alter the date associated to today() so i wouldnt have to go back and change all of my expressions. 

In regards to others who are asking what i'm trying to do with an example.  I performing different calculations in the dashboard based on todays date.  The problem is i'm working with stale data and need to change the date associated to today to let say 5/5/15.  That way aging of Orders and Shipments display correctly.  Appreciate the feedback.  Thanks.

Not applicable
Author

You can create your own today date value based on your data. Get the Max date from your data and assign the value to your custom defined value.

vCustomToday -->  =Max({1} DateField)