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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
alec1982
Specialist II
Specialist II

change date in demo data to future date logic

hi,

on one of my dashboards I use demo data.. I always face the issue that since I dont update the data the the date column info fails all in the past.. while i need it to always have the dates above today's year and under today's year + 5.

trying to find a logic to use within the script so any date prior to today will change to random future date..

Any one has used that in the past or has an idea?

2 Replies
Not applicable

Hi Badr

I would use a resident load on your demo data using the below script.

Date(IF(Date < Today(), Ceil(Rand()*365)+Today(), Date)) as NewDate

1.JPG

You can manipulate the 365 depending on how far in the future you want to go. The you can use NewDate as your date.

Kind Regards

adamdavi3s
Master
Master

Something like:

if(YourDate< Today(),makedate(year(Today())*Ceil(5*rand()),Ceil(12*rand()),Ceil(28*rand())), YourDate) as YourDateField