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: 
mstoler
Partner - Specialist
Partner - Specialist

condition expression for reload today in Nov 2017 Release

Hello,

I would like to create a condition that will only send the report if the reload is today.

What I did was create a variable in Qlik Sense vToday = Today().  I then created an expression to test if vToday = Today() but this does not seem to work.

Has anyone created a Condition in the Nov 2017 release with Qlik Sense Nov 2017 to only send the report if the reload is today?

Thank You,

1 Solution

Accepted Solutions
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Michael,

you have done (i think) almost all steps, but your mistake could be around your variable and lack of '=' sign before Tody() as it will only evaluate during reload, and not at the moment when app is used

I do it usually in following order:

  • create variables in the end of your script (please note how vToday and vConditionTrue variables habe single quotes and = sign) - you can copy paste everything from below

Let vLastReloadDate = Date(Floor(ReloadTime())); // this will store when document was loaded last time

Let vToday = '=Date(Floor(Today()))'; // this will re-calculate Todays date each time you (or NPrinting) will do anything in application

Let vConditionTrue = '=If(vLastReloadDate=vToday,1,0)'; // this will re-calculate Your condition

  • Then go to your NPrinting and create conditon like...

1.png

so the only difference is that i calculate true/false condition on Qlik side and i am expecting to run my task when it is 1 (which is "true" value for my condition)

cheers

Lech

---------------------------------------------

When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads as HELPFUL if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as HELPFUL if you feel additional info is useful to others.

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

1 Reply
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Michael,

you have done (i think) almost all steps, but your mistake could be around your variable and lack of '=' sign before Tody() as it will only evaluate during reload, and not at the moment when app is used

I do it usually in following order:

  • create variables in the end of your script (please note how vToday and vConditionTrue variables habe single quotes and = sign) - you can copy paste everything from below

Let vLastReloadDate = Date(Floor(ReloadTime())); // this will store when document was loaded last time

Let vToday = '=Date(Floor(Today()))'; // this will re-calculate Todays date each time you (or NPrinting) will do anything in application

Let vConditionTrue = '=If(vLastReloadDate=vToday,1,0)'; // this will re-calculate Your condition

  • Then go to your NPrinting and create conditon like...

1.png

so the only difference is that i calculate true/false condition on Qlik side and i am expecting to run my task when it is 1 (which is "true" value for my condition)

cheers

Lech

---------------------------------------------

When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads as HELPFUL if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as HELPFUL if you feel additional info is useful to others.

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.