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: 
HeinriG
Contributor III
Contributor III

NPrinting Conditions per User Filter

Hi,

I have a NPrinting Publish task that has multiple users it needs to send the report to. Each user has a filter that must be applied (each one is different) to the report before it is sent. This part of my task works as intended.

I am having a problem filtering out reports that are empty after the user filter has been applied, meaning I only want to send reports to users that have data available after their filter is applied. I have a condition that checks the count of items in the chart (to see if there are any records) and I use this as a condition on the task report. 

It seems that the condition is only checked once and is applied to all users and not evaluated per user as I would have thought (and what I interpreted from the help pages). 

Does anyone have insight into why this is or how I could implement it otherwise? Any assistance would be much appreciated.

Kind regards, Heinri

Labels (2)
1 Solution

Accepted Solutions
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

yep - thats all clear..

now down to your variable

The variable "vMM_WorkOrderCodeCount" is simply defined as "Count([Work Order Code])"... It should be defined as "=Count([Work Order Code])"

notice how I have added "=" sign which is required to allow for variable evaluation every time recipient filters are applied!

Try this and let us know how it goes.

Cheers!

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.

View solution in original post

9 Replies
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi, 

when you say: " I have a condition that checks the count of items in the chart (to see if there are any records) and I use this as a condition on the task report. "

Can you screenshot place where you put your condition in?

Is it Task or is it Report? I am confused with "task report" wording you have used 🙂

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

Hi,

Thank you for your reply.

Here is a screenshot of the condition I use:

HeinriG_0-1588052564372.png

The variable "vMM_WorkOrderCodeCount" is simply defined as "Count([Work Order Code])"

It is a publish task that will send the report attached to an email to multiple users. In this publish task you can add a few reports (I only have this one). So when I say task report, I mean the report set up inside of the publish task has a condition linked to it and not the entire publish task.

Please let me know if you need any more information, I hope it is more clear now.

Kind regards, Heinri

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

yep it makes more sense..

I was actualy asking for this kind of screenshot as I wanted to confirm that you are adding your condition at the place where marker no (2) is and NOT where marker no (3) is....

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

Hi,

Yes I see what you mean, I can confirm that I put the condition in where marker (2) is. 

So would you also expect the condition to be evaluated after each user filter?

Kind regards, Heinri

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

yep - thats all clear..

now down to your variable

The variable "vMM_WorkOrderCodeCount" is simply defined as "Count([Work Order Code])"... It should be defined as "=Count([Work Order Code])"

notice how I have added "=" sign which is required to allow for variable evaluation every time recipient filters are applied!

Try this and let us know how it goes.

Cheers!

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

Hi,

That seemed to do the trick! Thank you so much 🙂 

I see now that it is a bit counter intuitive as the variable is now evaluated on the total amounts in Qlik Sense but in Nprinting it is evaluated per user filter (like a dimension would in Qlik Sense).

Very interesting, good to know!

Kind regards, Heinri

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

no worries, I am glad I could help.

Just for the reference - official documentation regarding this:

https://help.qlik.com/en-US/nprinting/April2020/Content/NPrinting/Troubleshooting/Variables-dont-exp...

 

cheers!

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
Partner Ambassador/MVP
Partner Ambassador/MVP

Well... yes and no...

so in your condition you are actually expecting to see total, but with all the filters applied as per task,report and user filters...

but the trick is more on how in Qlik you use object and $ sign to expand your variable, when in NPrinting whatever is in variable definition gets passed to NPrinting.  The equal sign as you noticed causes expression to calculate and the actual value gets then returned.

 

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

Hi,

That's very true, that makes more sense 🙂

Thank you very much, NPrinting has been giving me some trouble lately but it seems to be coming together nicely 🙂

Kind regards, Heinri