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

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
LuisReco
Contributor
Contributor

Two conditions in an NPrinting filter

Dear experts,

I am applying this filter in NPrinting that works ok: 

=if(month(Today())=1 ,Year(AddYears(Today(),-1)),Year(Today()))

 

But I would like apply an improvement with another condition like this: 

=if(month(Today())=1 and day(today()) < 15,Year(AddYears(Today(),-1)),Year(Today()))

It's a pity but it doesn't work.

 

Is it possible have two diferent conditions. If not (as I think), Do you have any suggestion?

 

Thank you in advance.

Best regards,

 

 

Labels (2)
4 Replies
rubenmarin

Hi, I don't know why that doesn't work, if it's an evaluation that returns a single value it should work.

There are different ways to set the filters, one easy change for this case could be using DayNumberOfYear() like: =If(DayNumberOfYear(Today())<15,Year(AddYears(Today(),-1)),Year(Today()))

Digvijay_Singh

Can you share where exactly you are trying this, it worked okay in the qlik app - 

Digvijay_Singh_0-1769466333447.png

 

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi @LuisReco 

Filters usually don't work because they are not applied correctly. Things you must consider are:

  • data type of the filed you are trying to filter: 
  • filter type (Value, Numerical Value, Evaluate Value, Advanced Search)
  • are there other filters also applied which could affect result of the expression you are trying to do.

I wrote about many pitfalls when using NPrinting filters on below posts so you may want to check if any of those applies to your case.

Having multiple conditions in IF() statement will work if the filter is applied properly.

 

Lastly - you are running very old and no longer supported NPrinting (as you are indicating May 2021 SR4). Are you running compatible Qlik Sense version with it - meaning it is is on the compatible list? https://help.qlik.com/en-US/nprinting/May2021/Content/NPrinting/DeployingQVNprinting/System-requirem...

Lech_Miszkiewicz_0-1769466883696.png

 

 

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.
LuisReco
Contributor
Contributor
Author

Thank you Ruben. Finally both (yours and mine) worked. I made a mistake with the field to be evaluated in Nprinting.