Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
mahitham
Creator II
Creator II

Max(Month) load help

Hi Experts,

Can any one please help me on below requirement.

I have a qvd load  like below. Here Month Field contains the data from Jan to Sep.

How to load only Max(Month) data dynamically instead of hard code in where condition.

Please help me on this.

Load

Month,

ID,

Salary,

Branch

From …

where Month='Sep';

Thanks in advance.

1 Solution

Accepted Solutions
bbmmouha
Creator
Creator

try this

MaxMonth :

Load

max(Month) as maxMonth

From …

let vMaxMonth = peek( 'maxMonth',0,'MaxMonth') ;

drop table MaxMonth ;

Load

Month,

ID,

Salary,

Branch

From …

where Month='$(vMaxMonth)';

View solution in original post

4 Replies
bbmmouha
Creator
Creator

you can't like this you shoud load data with no condition

after this load the max(month) in a variable

after this you can reload data with the condition where Month = vMaxMonth

bbmmouha
Creator
Creator

try this

MaxMonth :

Load

max(Month) as maxMonth

From …

let vMaxMonth = peek( 'maxMonth',0,'MaxMonth') ;

drop table MaxMonth ;

Load

Month,

ID,

Salary,

Branch

From …

where Month='$(vMaxMonth)';

mahitham
Creator II
Creator II
Author

Thank you .. Its working

timpoismans
Specialist
Specialist

Using Max(Month) on Months that are stored as text will be difficult. You could possibly apply a mapping to the retrieved data if you want to work with Max(Month).

However, if you just want to retrieve the data of the current month, a simple:

     Where Month = Month(Today());

should suffice.