Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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 :
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
Thank you Lech. Is it possible to create a concatenated field (ie. ApplePhiladelphia) in NPrinting and apply a filter on that field? Thanks again.
Hi,
You have to create the field with the load script. Qlik NPrinting cannot create new fields on the source apps.
Best Regards,
Ruggero
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!
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.