Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
bharani8
Creator III
Creator III

Max Date from each month should appear in my List box

Hi Experts - Kindly find my qvw file.. I have date field ... What i need is.. I need a list box in which it should show only the last date of each month... and that should be converted to a Month name...

Eg., in Aug if we have 29th Aug 2017, 30th Aug 2017, 31st Aug 2017... in my list box it should show only 31st Aug and it should appear as Aug-2017

36 Replies
bharani8
Creator III
Creator III
Author

I see only one date in my list box (max date) other months max date is not seen.. any idea ?

i have used below as exp..

=MonthName(If (YDAY=Aggr(Max(YDAY),Month_Name), YDAY))

tresesco
MVP
MVP

Check if your date field is properly being converted to number (default - Right aligned in listbox) or a text (default - Left aligned in listbox). The above logic would only work if it is a number ( left-aligned).

bharani8
Creator III
Creator III
Author

Now i see date... but only one date i see in my list box...

Test123.PNG

tresesco
MVP
MVP

What expression have you used to create your Month_Name field in the script?

bharani8
Creator III
Creator III
Author

i used below exp..

Month(YDAY) as Month_Name,

and my Timestamp in QVD and QVW is

SET TimestampFormat='M/D/YYYY h:mm:ss[:ss.fff TT]';

tresesco
MVP
MVP

Check this: Preparing examples for Upload - Reduction and Data Scrambling and see if you can share your sample app.

bharani8
Creator III
Creator III
Author

Thanks Tresesco!! Now i got it... i used below exp..

=MonthName(aggr(max([As of Date]),Month_Name,Year_Name))

[As of date] is the Date of Yday.. and as i had different years.. i added Year_Name as well..

bharani8
Creator III
Creator III
Author

But now i see all the dates particular to that month is getting selected

tresesco
MVP
MVP

That is exactly why you need to put IF clause as I showed like:

=MonthName(If (DateField = aggr(max(...

bharani8
Creator III
Creator III
Author

When i apply this if condition... i see only latest month in year 2017 and max month in 2014... Rest alll months and their respective year is not to be seen