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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Finding Max by Month

Hello All,

I am newbie to Qlikview and need help in getting resolution for below scenario.

I have a table with following structure and data and I need to find latest record by Month.

  

DateMonthIDNameSysid
7/10/2015 12:38Jul-158ABC15
7/23/2015 9:12Jul-159ABC26
8/8/2015 19:29Aug-1514LMN7
9/29/2015 11:34Sep-1517XYZ18
9/29/2015 16:20Sep-1519XYZ29

Expected Output

  

MonthName
Jul-15ABC2
Aug-15LMN
Sep-15XYZ2

I wanted to find maximum by each month based on Date and Sysid fields.

I have gone through few of the posts which uses Max & Aggr functions however I am not able to achieve above expected output.

Could anyone pls help on this?

Regards

11 Replies
sunny_talwar

Script

Table:

LOAD *,

  Date(MonthStart(Date), 'MMM-YYYY') as Month;

LOAD * INLINE [

    Date, ID, Name, Sysid

    7/10/2015 12:38, 8, ABC1, 5

    7/23/2015 9:12, 9, ABC2, 6

    8/8/2015 19:29, 14, LMN, 7

    9/29/2015 11:34, 17, XYZ1, 8

    9/29/2015 16:20, 19, XYZ2, 9

];

Capture.PNG

Not applicable
Author

Thanks Sunny. By using MonthStart while loading has worked as expected.

Thanks others as well who have responded with their suggestions.

Regards,

Nikhil