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

Send a report email on the second working day of each month in NPrinting

Hello, I am currently encountering a problem.

We need to send report emails to customers on the second working day of every month (except weekends), but I found that npriting has no direct setting option. I hope you can help me,if you have any way.

Or I can judge variables by condition?

Thanks very much.1.png

Or I can judge variables by condition?

2.png

Labels (1)
1 Solution

Accepted Solutions
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

hahahaha..this should be rather straight forward. You ask:  "so how should I set the second working day?" well it all depends on where you live and what you consider working days.

In Australia where I live it is quite simple if we assume following:

  • We have typical working days Mon-Fri
  • and then we have public holidays which obviously we need to have captured somewhere.
  • Then when creating a calendar table in Qlik Sense we flag those days by excluding weekends and public holidays. I mean what else would you expect? 

Once you have working days flagged then you can number them in load script. You can even add dedicated flag for NPrinting checking that MonthStart(date) = MonthStart (Today() and you do min(date,2) where flag IsWorkingDay=1.

The judgment shouldn't be difficult point. It is binary in my opinion it either is or isn't working day within the rules you create.

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

4 Replies
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi, 

Indeed there are only 2 options:

  • conditions as you suggest - although I do not recommend the method you are using which is hard to validate. Instead do variable logic in Qlik so your variable returns 1 or 0 and do comparison in NPrinting to constant value. It makes troubleshooting your logic much easier.
  • use of API - same logic needs to be written in Qlik load script and based on outcome you can trigger API call or not. More about API setup here: https://nprintingadventures.com/2019/04/08/nprinting-api-qlik-rest-subroutines/
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.
LRAngela
Contributor III
Contributor III
Author

thanks!

I understand what you mean is to set a variable in the qlik script to judge whether the current day is the second working day, so how should I set the second working day?

I think the judgment of the second working day is a difficult point.

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

hahahaha..this should be rather straight forward. You ask:  "so how should I set the second working day?" well it all depends on where you live and what you consider working days.

In Australia where I live it is quite simple if we assume following:

  • We have typical working days Mon-Fri
  • and then we have public holidays which obviously we need to have captured somewhere.
  • Then when creating a calendar table in Qlik Sense we flag those days by excluding weekends and public holidays. I mean what else would you expect? 

Once you have working days flagged then you can number them in load script. You can even add dedicated flag for NPrinting checking that MonthStart(date) = MonthStart (Today() and you do min(date,2) where flag IsWorkingDay=1.

The judgment shouldn't be difficult point. It is binary in my opinion it either is or isn't working day within the rules you create.

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

I forgot to reply, I built a script to judge Monday to Friday according to your prompt, and restricted it by condition, it is already working normally, thank you very much.