Skip to main content
Announcements
Defect acknowledgement with Nprinting Engine May 2022 SR2, please READ HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
tomdon14
Contributor III
Contributor III

NPrinting Filter Exclusion

Hi all –

I’m struggling with creating a NPrinting filter and hoping you might be able to help. It seems like a fairly straightforward request but not sure how to implement it.

An example data set:

Product      City of Sale
Apple           Philadelphia
Apple           New York
Apple           Chicago
Orange        Philadelphia
Orange        New York
Orange       Chicago
Pear             Philadelphia
Pear            New York
Pear            Chicago

For my report, I want to exclude Apples and Pears if they are sold in Philadelphia. Can I create something using the Advanced Search Filter to exclude only those items?

Thanks in advance.

Labels (2)
5 Replies
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Remember that filters in NPrinting are the same as selections in Qlik Sense. If you wish to apply filters on Product or City fields it will not be possible, so no - there is no way you can apply such filter with this data set. 

What you are showing us is a combination of 2 fields which in your case are stored as 2 separate fields. If that is the case you will not be able to apply what you are trying to as selection on one field will be global and exclusion will be applied on all rows where Apples and Pears are. 

Solution would be to :

  • create composite field in your data model, which would be built of those 2 fields.
  • or use another field (some field from fact table which will uniquely describe combination of Product and city and apply advanced filter on that field) see below example:
Load 
	*,
	Rand()*1000 as sales
Inline
	[Product,      City of Sale
	Apple,           Philadelphia
	Apple ,          New York
	Apple ,          Chicago
	Orange,        Philadelphia
	Orange ,       New York
	Orange ,      Chicago
	Pear,             Philadelphia
	Pear ,           New York
	Pear,            Chicago
	]
;

 

loading this as a data model you can then apply advanced filter on "sales" field using following Advanced search expression:

=sum({<Product={"*"},[City of Sale]={"*"}>-<Product={'Apple','Pear'},[City of Sale]={'Chicago'}>}sales)>0

regards

Lech

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.
tomdon14
Contributor III
Contributor III
Author

Thank you Lech. Is it possible to create a concatenated field (ie. ApplePhiladelphia) in NPrinting and apply a filter on that field? Thanks again.

Ruggero_Piccoli
Support
Support

Hi,

You have to create the field with the load script. Qlik NPrinting cannot create new fields on the source apps.

Best Regards,

Ruggero



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

That is what I called "composite field" and as I said before it needs to be done in data model (not in NPrintig). Ruggero confirmed the same!

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.
tomdon14
Contributor III
Contributor III
Author

Thank you all. I've been able to identify a unique identifier for each row (RowID) and use that to exclude the items in question. It's not a perfect solution but it looks like it will work.