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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to create a new table inside Qlik with a range of date

I want to create a new table which will give me all the dates from 01/01/2014- to today's dates.

8 Replies
MarcoWedel

Hi,

maybe like this:

QlikCommunity_Thread_234377_Pic1.JPG

...

QlikCommunity_Thread_234377_Pic2.JPG

newtable:

LOAD Date(MakeDate(2014)+RecNo()-1) as Date

AutoGenerate Today()-MakeDate(2014)+1;

hope this helps

regards

Marco

sunny_talwar

Just to add another option, you can do this:

NewTable:

LOAD Date(MakeDate(2014)+IterNo()-1) as Date

AutoGenerate 1

While IterNo() <= Today() - MakeDate(2014) + 1;

Not applicable
Author

Hi Marco/Sunny,

It was very helpful.Could you please explain the working of the code.?

Thanks,

Ankit

Not applicable
Author

Hi sunny ,

Can you please let me know how can I change al the dates to YYYY-MM-DD format,I am getting dates in mm/dd/yyyy format.

Not applicable
Author

Hi Marco,

Can you please let me know how can I change al the dates to YYYY-MM-DD format,I am getting dates in mm/dd/yyyy format.

MarcoWedel

Hi,

either change your DateFormat variable accordingly or use a format string in the Date() function:

QlikCommunity_Thread_234377_Pic3.JPG

LOAD Date(MakeDate(2014)+RecNo()-1,'YYYY-MM-DD') as Date

AutoGenerate Today()-MakeDate(2014)+1;

hope this helps

regards

Marco

ramasaisaksoft

Hi Ankit,

Just add the below code into your script. and create a list box to view the result

[New table]:

load date(MakeDate(2014)+IterNo(),'MM/DD/YYYY') as date

AutoGenerate 1

While IterNo()<=Today()-MakeDate(2014)+1;

Anil_Babu_Samineni

You need this

date(date#(MakeDate(2014)+IterNo(),'MM/DD/YYYY'),'yyyy-mm-dd') as date


Please close this thread using flag of helpful or correct answer which you sit the perfect


And I recommend please read all dates in qlikview

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful