Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
gshockxcc
Creator
Creator

Load Year/Month/Day from .qvd file

I have a series of csv files that I have loaded into a qvd file.  See the thread here: http://community.qlik.com/thread/113287

I am trying to load the year, month, and day from the "Date" field.  I have a separate .qvw file where this works fine, and there are several posts here that show how to do this.  Since my file has a loop to add new .csv files to the .qvd, I don't know where to put the LOAD statement to make this work.  I have made several attempts by trial and error, but I can't figure out how to make this work.

I have a different file where this works fine, but all of the data is loaded from a single .xlsx file.

So I have no idea where this LOAD statement should go:

Directory;

LOAD Date,

  Month(Date) as MonthDate,

  Time(Date) as TimeDate,

  Year(Date) as YearDate,

  Day(Date) as DayDate;

The above code causes an error with the Autogenerate line in the attached file.

Thanks,

-Kristan

1 Reply
its_anandrjs

Use the master calendar for the application and create a master calendar from the date field and then connect them some thing like example.

Let varMinDate = Num(Makedate(2006,1,1));

Let varMaxDate = Num(Makedate(Year(today()),Month(today()),Day(today())));

Datefield:

LOAD

Date($(varMinDate)+IterNo()-1) AS Datefield,

Year(date($(varMinDate)+IterNo()-1)) as Year,

Month(date($(varMinDate)+IterNo()-1)) as Month,

Day(date($(varMinDate)+IterNo()-1)) as Day,

Time(date($(varMinDate)+IterNo()-1)) as Time

AUTOGENERATE (1)

WHILE $(varMinDate)+IterNo()-1<= $(varMaxDate);