Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content
Announcements
March 26 at 10am ET: See how Qlik drives growth and value in ISV segment - REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
mahitham
Creator II
Creator II

Max(Month) not working

Hi Experts,

Can any one please help me on below requirement.

I have a date field in Timestamp format.

I have converted timestamp  format to normal date format like below

Date(Reportdate) as Date,

MonthName(Date(Reportdate) )    as ReportMonthName

 

But by taking Max(MonthName) I am getting the Month like below

max date.png

I have tried like this also in set analysis but getting 0 value instead of 20. Please help me on this.

Sum({<ReportMonthName={'$(=Date(Max(ReportMonthName),'MMM YYYY'))'}>}[ID])

 

 

9 Replies
Shubham_Deshmukh
Specialist
Specialist

what exactly you are expecting?

xavieravinson
Contributor III
Contributor III

Hi Are you using KPI chart. Try text object.

mahitham
Creator II
Creator II
Author

HI @Shubham_Deshmukh 

I have tried the above but its not working.

Please find the below attached app and QVD.

max date.png

I am looking for max of month feb 2019 count .

Thanks in advance.

 

 

xavieravinson
Contributor III
Contributor III

use =sum({<Month={"$(=max(Month))"}>}Count)

mahitham
Creator II
Creator II
Author

Hi @xavieravinson 

I have tried your solution getting 0 instead of 20.

Could you please check the above app and QVD.

Thanks in advance.

Shubham_Deshmukh
Specialist
Specialist

We cannot put it on month it will give wrong result if we put it on month, so it has to be on dateField

Try this , m getting correct result by using this one for dateField,

//get dateField = date(dates) in other table using Resident Load

=Sum({<dateField= {'$(=Max(dateField))'}>}sale)

 

Apply this and change date format to MMM,YY as you want.

Let me know it works for you or not.

 

mahitham
Creator II
Creator II
Author

Hi @Shubham_Deshmukh 

By using the above expression getting only max date count i.e., 8 but I have to show max month i.e., feb 2019 count with value as 20.

I have added month format but still not working getting 0. Could you please attach the app so it helps

Sum({<ReportDate={'$(=Date(Max(ReportDate),'MMM YYYY'))'}>}Count)

 

Shubham_Deshmukh
Specialist
Specialist

Hi,

Try this now,

//num(month(dates)) as monthNum, year(dates) as yearNum,

=Sum({<yearNum={$(=Max(yearNum))},monthNum={$(=Max({<yearNum={$(=Max(yearNum))}>}monthNum))}>}sale)

It will take out max month from max year.

Shubham_Deshmukh
Specialist
Specialist

Hey @mahitham ,

Solution worked for you?