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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
davyqliks
Specialist
Specialist

Max Month-Year issue

I wonder if you might be able to help with the following.

When I have the below:

Sum({<[Year]={'$(=num(Max([Year])))'}>} HKD_Price)

I get a correct result

But when trying the same with Month-Year I have no return

Sum({<[Month-Year]={'$(=num(Max([Month-Year])))'}>} HKD_Price)

Do you have any idea why this may be returning a blank?

I have also tried the following with – as the return

Sum( {< [Month-Year] = { '$(=Max([Month-Year])' } > } HKD_Price )

Note, If I sum HKD_Price and select all Month -Year for 2019 I am getting the correct return

 

My Date Value is called [Voucher Date]

Thank you As always, any advise would be much appreciated.

Labels (2)
12 Replies
davyqliks
Specialist
Specialist
Author

HI,

While making you a sample i realised why i am getting the 0.00 return.

I use a currency conversion to get my HKD_Price.

These are not confirmed until the end of the month and so no currency conversion for DEC.

When i sum(HKD_Price) for Dec the return is blank.

Therefor, this is affecting the return value for max.

Is there a way of adding to the syntax something to  state max complete Month-Year, so i am getting the value for Nov 2019 until Dec 2019 is past the 31st?

this  is working when selecting jan 19 to nov 19

Sum({<[Month-Year] = {"$(=Date(Max([Month-Year]), 'MMM-YYYY'))"}>} HKD_Price)

I hope that's clear, thanks again sunny.

Daniel

sunny_talwar
MVP
MVP

May be this

Sum({<[Month-Year] = {"$(=Date(Max({<HKD_Price *= {[*]}>}[Month-Year]), 'MMM-YYYY'))"}>} HKD_Price)
davyqliks
Specialist
Specialist
Author

Hi Sunny,

Thats got  it, Shows the HKD_Price for the last completed Month (Nov)

Thank you so  much for your time, expertise and patience, its really appreciated.

Kind Regards

Daniel