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

create a random date column

hi all,

I have a dashboard used for demo purposes. one of the columns on it is a date column (expiration date). the data comes from an excel file and I have to update the dates column every several months to make sure they are in the future.. is there anyway I can create a dynamic column to show random dates within the next year or two years?

Thanks,

Alec

1 Solution

Accepted Solutions
sunny_talwar

May be do this:

Table:

LOAD Date(Today() + Floor(Rand()*365)) as FutureDates

AutoGenerate 50;

View solution in original post

7 Replies
sunny_talwar

May be do this:

Table:

LOAD Date(Today() + Floor(Rand()*365)) as FutureDates

AutoGenerate 50;

awhitfield
Partner - Champion
Partner - Champion

Hi Alec,

check out the attached thread, tweaking the start and end as required.

Andy

https://community.qlik.com/thread/104652

sunny_talwar

For one year use 365, for two you can use 730 and so on....

Table:

LOAD Date(Today() + Floor(Rand()*365)) as FutureDates

AutoGenerate 50;

HTH

Best,

Sunny

alexandros17
Partner - Champion III
Partner - Champion III

Try this expression:

Date(Num(Today()) + 365 - DayNumberOfYear(Today()) + Rand()*732)

Anonymous
Not applicable

tmp_MaxDate:

Load min(OrderDate) as mindate,

max(OrderDate) as maxdate

from excel;

LET vMinDate = Peek('mindate',0,'tmp_MaxDate');

LET vfutureDate = today()+90;

LET vMaxDate = Peek('maxdate',0,'tmp_MaxDate');

drop table tmp_MaxDate;

//To get the calendar from your minimum date to maximum date +90 days

//********************* Temporary Calendar ***********************//

tmp_CALENDAR:

LOAD

  Date($(vMinDate) + RowNo() - 1) AS tmp_Date

AUTOGENERATE

  $(vMaxDate) + $(vfutureDate ) + 1;

alec1982
Specialist II
Specialist II
Author

Thank you all!

sunny_talwar

Not a problem, glad we were able to help.

Best,

Sunny