Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikView forum consolidation is complete. Labels are now required. LEARN ABOUT LABELS
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

Hi Marco/Sunny,

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

Thanks,

Ankit

Not applicable

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

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

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)