Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a field YearMonth (format: jan. 2021).
Today Im using =YearMonth=max(total YearMonth) to get the latest YearMonth when I open the app.
I want to use a filter in NPrinting to show last 2 months data.
How can I do this?
BR,
Artur
Hi @Uri
Have you gone through the links I have sent in my previous post? So the first question is:
Understanding how is your calendar built as well as if there is association with date field could help as well as I would then use different formulas to select your month year field. I would use this option:
There is no point talking about filters if we dont know how is your calendar built. It is not really NPrinitng question - it is Qlik Sense question.
... or maybe you are using autogenerated calendar from Qlik Sense by using "derived fileds" ???
Hi Artur,
you can add a new value in the same filter and add the previous month.
The formula could be =YearMonth=max(total YearMonth)-1 but this depends on how you defined the YearMonth field
Here you have short scenarios and things you have to be aware of when working with Advanced Searches and also When working with dates...
https://nprintingadventures.com/2019/06/26/nprinting-filters-part-3-advanced-search/
https://nprintingadventures.com/2019/02/15/the-pitfalls-of-nprinting-filters-part-1-dates-and-duals/
+
landing page: https://nprintingadventures.com
Hi guys,
YearMonth defined as MonthName(dat) as YearMonth.
I already tried like =YearMonth=max(total YearMonth)-1 and it didn't work.
BR,
Artur
Hi,
Could be a problem due to the dual representation of data. Try to force to Text().
Remember also that when you use formulas in filters, you have to select Evaluate value from the dropdown menu.
Best Regards,
Ruggero
Hi @Uri
Have you gone through the links I have sent in my previous post? So the first question is:
Understanding how is your calendar built as well as if there is association with date field could help as well as I would then use different formulas to select your month year field. I would use this option:
There is no point talking about filters if we dont know how is your calendar built. It is not really NPrinitng question - it is Qlik Sense question.
... or maybe you are using autogenerated calendar from Qlik Sense by using "derived fileds" ???
=AddMonths(max(total YearMonth),-1) did the trick.
My YearMonth field looks like this:
MonthName(dat) as YearMonth and stored like (dec. 2020). I will go through your links since I'm still not getting why text() didn't work... I really appreciate your help guys.
BR,
Artur
Text did not work because your YearMonth field is not text field!!!
You always need to know what data type you are working with... Since it is created by using monthname function it is actually dual field which contains numerical representation and text sumbol of it. For all dual values NPrinting is requiring numerical filter which is documented here:
I also mention all this in one of my blog topics "Pitfalls of NPrinitng filters dates and duals...."