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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
dunnalahk123
Creator III
Creator III

Load Max Month in Script

Hi,

I have a QVD where it will have all months but i always i want to take latest month data from that QVD.

Month Format : 201802

FROM

(qvd)

where Month=Max(Month);

i used above condition but it always fails, can some one guide me how can i give where clause condition.

Best Regards,

Hk

1 Solution

Accepted Solutions
ychaitanya
Creator III
Creator III

use as

Temp:

Load Month(Max(Date(Date#(Date_Field,'YYYYMM')))) as Max_Month_Date

Resident your_table_name;

1 way :

Load *

Resident Your_Table_name

where Exists (Month(Date_Field,Max_Month_Date);


Drop Table Temp;


2 way :


Load Month(Max(Date(Date#(Date_Field,'YYYYMM')))) as Max_Month_Date

Resident your_table_name;

Let vMaxMonth=Peek('Max_Month_Date',0,'Temp');


Load *

Resident Your_Table_name

where Month(Date_Field)='$(vMaxMonth)';



Thanks

CY

View solution in original post

3 Replies
shiveshsingh
Master
Master

Try

Month=Date(Max(Month),'YYYYMM')

micheledenardi
Specialist II
Specialist II

The best way to do this is by using Max() function:

Load:

Max(Month) as Month

FROM (qvd);

Michele De Nardi
If a post helps to resolve your issue, please accept it as a Solution.
ychaitanya
Creator III
Creator III

use as

Temp:

Load Month(Max(Date(Date#(Date_Field,'YYYYMM')))) as Max_Month_Date

Resident your_table_name;

1 way :

Load *

Resident Your_Table_name

where Exists (Month(Date_Field,Max_Month_Date);


Drop Table Temp;


2 way :


Load Month(Max(Date(Date#(Date_Field,'YYYYMM')))) as Max_Month_Date

Resident your_table_name;

Let vMaxMonth=Peek('Max_Month_Date',0,'Temp');


Load *

Resident Your_Table_name

where Month(Date_Field)='$(vMaxMonth)';



Thanks

CY