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: 
Rado
Contributor
Contributor

Npriting- Variable in TO/CC

Hello folks,
I set up variable in the Codata app:

=If( [Snapshot date]= Floor(Today()), 'mail1@mail.com', 'mail2@mail2.com')

Then I put the variable into CC in the Nprinting task publisher in email message section.

1. trigger is set up on time when current day snapshot is not ready.
2. trigger is set up on time when current day snapshot is ready.

Email sending is working, however not right.
During the 1. trigger (snapshot not ready) it should send email only to  'mail2@mail2.com'
It sending it on both emails during the both triggers.

How to solve it?

I assume that there could be some problem for Nprinting with [Snapshot date]= Floor(Today()) ?
Or when there is in the condition two emails with comma " 'mail1@mail.com', 'mail2@mail2.com' " maybe it cant take it like condition?

thank you in advance for your advise.

Rado


Labels (3)
9 Replies
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi @Rado 

Hard to say where you are going wrong without seeing it all - this normally involves quite of few moving parts so I usually start by removing any moving ones:

1. Golden rule is - your variable needs to be expanded - there is whole section in help about it so make sure you check that: https://help.qlik.com/en-US/nprinting/May2023/Content/NPrinting/Troubleshooting/Variables-dont-expan...

2. You can set this variable directly in load script, right? that way there will be no issue and it will not try to calculate anything when NPrinting is running but at the time when Qlik app reload is going it will be calculated and set. Then it would be much easier to troubleshoot.

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.
Parthiban
Creator
Creator

First you check in Qlik. 

If( [Snapshot date]= Floor(Today()), 'mail1@mail.com', 'mail2@mail2.com')

the output of this formula is must be any one of this mail in Qlik like mail1@mail.com  or  mail2@mail2.com . You achieve in Qlik means NPrinting automatically send the mail to that particular mail user.

NPrinting consider only output of the variable in Qlik. It will not try to calculate in NPrinting side.

Rado
Contributor
Contributor
Author

Hello Guys,
I checked it in the QS however it seems quite good.

But when I apply the variable what is defined in the app its doesnt work right.

Well so lets think like this. 
I want to send email only in case when  [Snapshot date]= today.
Do you have some suggestions how to define the Variable?

I assume that I have to define this variable with condition in the app.
Then in the Nprinting I can use it like this:

Rado_0-1701444130004.png

 

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi @Rado 

I think we are lacking some fundamental understanding of how this works.

  • For you for this to work variable needs to return a correct email
    • your condition is: when  [Snapshot date]= today
    • question: is it possible that in your data set when you are trying to send report you will have multiple snapshot dates?
      • If yes - then it is obvious that it will not work as first you would have to apply filter for that particular snapshot date.
      • If no and there is always only 1 snapshot date in data set then you are doing something wrong

Variablem email delivery does not mean that it will filter data automatically - it means it can provide variable based email based on selections (filters) applied in NPrinting. So the option is to have 2 user filtes created with filters Snapshot = today and snapshot <> today - but then you dont really need variable email as you can just use regular email.

For us to understand the whole scenario you would have to explain little bit more on what you do with the data, what data you are loading to Qlik app (one or more snapshots), if it is more then one what is your expectation? Whether you want to filter it and then send to one or another email or if there is todays snapshot present you would send report with all snapshots data to one or another email.

Obviously I am guessing here a lot, but my feeling is that you thought variable filter will somehow automatically filter your data too which is not a case as that is not what it is designed for. Correct me if I am worng.

cheers

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

Hello Lech, 
first of all thank you for your willingness. 🙂

Currently I have set up trigger on specific time with filter on Snapshot = Today.
It is exporting views each day, on the time.
When app is updated and contains "today" it exports right views and sends email.
When app is not refreshed yet (delay), it sends "blank" view, because it doesnt contains data from "today".

What I want:
I want to send email only when it contains today snapshot.
And yes the field Snapshot date contains more dates, also for previous days.

I expected that when I will set up the variable in the app, and then I will place the variable into the TO (receiver) it will works.

I hope, that now its describe better to give me some insights/query 🙂 

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi @Rado 

If I understand correctly you only want to send eamil when there is todays snapshot, right?

If that is true, then why do you need to use variable email at all? it is not required - you can have static email and the only thing you need is a task condition checking if todays snapshot is in the app. You can achieve that by using Qlik variable or UI object which would have values or would be empty in case there is no data.

https://help.qlik.com/en-US/nprinting/May2023/Content/NPrinting/ReportsDevelopment/Conditions.htm

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

Hello Lech,
yes I have set it up like this right now.

However there is requirement to send it only when it contains right view.
Do not send it when views are empty.

Due to this I want to set up some condition what will send it only when it contains snapshot date from today 🙂

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi @Rado  - that is exactly what tasks conditions are for.

For example:

You can create Qlik Sense table object with:

  • "include 0 values" disabled,
  • Snapshot Date as dimension
  • Only({<SnapshotDate={'$(=Date(Today()))'}>}SnapshotDate) as a measure
    • you can see that chart is empty (1) when there is no snapshot date = today
    • and there is data if there is snapshot date = today

Lech_Miszkiewicz_0-1701904836163.png

Then in NPrinting you create a condition when you relate to this object and say: Chart - find the chart with your condition and choose option "Contains values"

Lech_Miszkiewicz_1-1701904989217.png

Then in Task you add the condition and decide when task needs to run (on True or False of your condition):

Lech_Miszkiewicz_2-1701905151756.png

Thats it.

 

With this setup you will only generate report when there is todays snapshot in the data and as mentioned before you dont need any variable emails for it as variable email purpose is completely different by design.

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

Hello Lech,
thank you very much for this solution and detailed explanation.
Really appreciate your willngness.

Seems this should work.
I implemented it, and will see in next update, how it is working.
Then will let you know.

Thank you,
Rado