
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Or I can judge variables by condition?
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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/

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
