Skip to main content

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
On-Demand Webinar: Learn proven best practices for a smooth transition to Qlik Sense® SaaS. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

pulling sql's one month data in qlikview

Hi Experts,

i have a sql table which has 2015 whole data.

from this table, i want to load monthly datas in qlikview and store in qvd.

Sql date format is like 'YYYY-MM-DD'

How can i do this.

Please help.

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Perhaps like this:

Temp:

LOAD *, Month(MyDate) as Month

SQL Select * From My2015Table;

For i=1 to 12

     MonthlyData:

     Load * Resident Temp Where num(Month) = $(i);

   

     Store MonthlyDate into MonthlyData2015_$(i);

     Drop Table MonthlyData;

next


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

Perhaps like this:

Temp:

LOAD *, Month(MyDate) as Month

SQL Select * From My2015Table;

For i=1 to 12

     MonthlyData:

     Load * Resident Temp Where num(Month) = $(i);

   

     Store MonthlyDate into MonthlyData2015_$(i);

     Drop Table MonthlyData;

next


talk is cheap, supply exceeds demand
sathishkumar_go
Partner - Specialist
Partner - Specialist

Hi,

1) load the distinct date field

2) create one variable to get the no of rows in the table

3) use for loop

4) in for loop to pass the query and use the where condition to load only particular month data only

5) create a qvd. qvd name should be QVDNAME_MONTH

------------------------------------------

Temp:
LOAD DISTINCT
  Date AS Date_Temp
FROM
query;

LET v_nr_folders = NoOfRows('Temp');


FOR i=0 to $(v_nr_folders)-1

LET v_Date = Peek('Date_Temp',$(i),'Temp');

QUERY
SQL SELECT *
FROM TABLE NAME WHERE Date = '$(v_Date)';


STORE TableName into Path\$(v_File_Name).qvd;

drop table TableName;

next