Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted
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
Highlighted
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

Highlighted
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

Highlighted
Creator II
Creator II

Thank you .. Its working

Highlighted
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.