Qlik Community

Qlik NPrinting Discussions

Discussion Board for collaboration on Qlik NPrinting.

Announcements
Join us for live office hours! Q&A with Qlik on Dec 14 at 10am EST: Refining Reports and Visualizations
cancel
Showing results for 
Search instead for 
Did you mean: 
tomarnold-amaris
Contributor
Contributor

nprinting filter condition - prior month

hi - please dont say this is a repeat, ive searched all around and trust me it might have been asked, but for whatever reason mine is not working, i've read all the related threads, non help.

 

Nprinting filter condition issue.  I'm trying to filter on prior month, so im using evaulate set to =Month(Today())-1
It errors when you run it.

=Month(today()), works and brings back the current month.  But the -1 just makes it fail.

I got the guidance from here: https://help.qlik.com/en-US/nprinting/April2019/Content/NPrinting/ReportsDevelopment/Static-dynamic-...

I've tried 

=(Month(Today())-1)

=Month(Now())-1

=Date(MonthsAdd(Now(),-1))

all generate an error. The column is looking up vs Month which is numeric e.g. 6 for june.

Labels (2)
2 Replies
Lech_Miszkiewicz

How about

Floor(month(today())-1)

 

Those  kind of issues we need to investigate usually by starting exposing field we want to filter in Qlik Sense table and trying to show it as text and as number to see if field is actually stored as text or as number or as dual…

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
Lech_Miszkiewicz

On the other hand since you mentioned that it works for current month i am thinking if it actually expects text format instead of number.

when doing -1 for last month we are converting it to number. So maybe you need to pass text value in your case…

i would try following:

text(month(addmonths(today(),-1)))

or just

month(addmonths(today(),-1))

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.