Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
jlampard40
Contributor III
Contributor III

Maximum count within a date range

Hi guys - I have a range of data (see attached sample) and I would like to identify the maximum value relating to the whichever date this occurs on (WBR_Stat_Date) in the data.   Also the minimum.

I'd also like to (in a separate column in my table) state the date itself which corresponds to the Max and Min accordingly.  Can you guide me please - many thanks in advance.

🐵 

Labels (3)
4 Replies
jlampard40
Contributor III
Contributor III
Author

MIN Value should relate to 09/01/2019 in sample data guys, sorry - not 02/01/2019.  My apologies.  

Kushal_Chawda

how is the expected output?

Kushal_Chawda

Create straight table 

Dimension -
WBR_Stat_Date

Expression -
1) Count of Key 
=Count(WBR_Event_Key)

2) Min/Max Value
=if(WBR_Stat_Date = FirstSortedValue( total WBR_Stat_Date, -aggr(Count(WBR_Event_Key),WBR_Stat_Date)), 'Max Value: '& WBR_Stat_Date,
if(WBR_Stat_Date = FirstSortedValue( total WBR_Stat_Date, aggr(Count(WBR_Event_Key),WBR_Stat_Date)), 'Min Value: '& WBR_Stat_Date
))
Brett_Bleess
Former Employee
Former Employee

If Kush's post helped, do not forget to come back to the thread and use the Accept as Solution button on his post to give him credit for the help and to confirm to other Members that it did work for you.  If you need further help, please leave an update, as otherwise folks are unlikely to add additional ideas, and if you figured out something else, consider posting that and then mark that as the solution.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.