Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I've found some things indicating I need to do set analysis, and even found some syntax, but the challenge I'm running into is that my date field is in the format YYYY-MM. I think that makes it a text field, and I believe using the max function isn't working properly. Does anyone know how to do the syntax so that I can set an expression to only return the results for the max date?
Here are the two attempts I've made so far (but I think I might be getting some Qlikview syntax mixed in here....I'm really new to this, so the syntax is a challenge for me):
=Sum({<[Year-Month] = {"$(=Max([Year-Month])"}>}Count)
=sum({<[Year-Month]={'=(max([Year-Month]))'}>}Count)
Did you may be missed a parenthesis in your first expression?
=Sum({<[Year-Month] = {"$(=Max([Year-Month]))"}>}Count)
If you think that your Year-Month is not read as date, I would suggest you to make it read as a date in the load script like this
Date(Date#([Year-Month], 'YYYY-MM'), 'YYYY-MM') as [Year-Month]
and then try this
=Sum({<[Year-Month] = {"$(=Date(Max([Year-Month]), 'YYYY-MM'))"}>}Count)
Thanks! I took a different approach and created a Date Sort Key that was Year*12+Month so that I could use the max function without having to mess with date formatting.
This worked for me:
=Sum({<[Date Sort Key] = {"$(=Max([Date Sort Key]))"}>}Count)
Yup, that's another way to do it...