Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
colinodonnel
Creator II
Creator II

Setting variable-based conditions

Hello,

 

How can i evaluate this expression? i.e. check that it is giving the expected result

colinodonnel_0-1683639167453.png

 

The variable contains a date/time in number format.

What expression can i write to check if it matches? e.g =num(now())?

 

Thanks,

Colin

Labels (1)
1 Solution

Accepted Solutions
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi @colinodonnel 

no, I was not talking about admin rights. I was talking about dedicated role/permissions for your requirements which I dont see problem with as it falls under different criteria than import task: 

Lech_Miszkiewicz_0-1683881021703.png

Regarding your questions:

  1. There is no way to preview expression evaluation in NPrinting, but...
    1. I think one of your components is not working properly and I think it is not expression. It is likely to be the other end which I assume is a variable and which may not expand as explained here: https://help.qlik.com/en-US/nprinting/May2022/Content/NPrinting/Troubleshooting/Variables-dont-expan...
      1. Is your variable set to numerical value in load script?
      2. Or is it UI variable with formula in it which in that case should have formula starting with "=" sign as mentioned in link above. 
      3. Try to set it to something simple like '=Floor(Today())' on one end and then do =Floor(Today()-1) on another end to test if it works

 

I would encourage you to expose the variable you are trying to use in your condition in a report. 

When it comes to second question "When is the data transferred from the Qlik app to the nPrinting console i.e. such as a variable value? Is it only when the connection is refreshed?" normally you wouldn't need to regenerate metadata as variables and data should be updated as soon as app is updated and in Qlik sense memory. 

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

8 Replies
Frank_S
Support
Support

That seems reasonable.

Can you show us or describe  in detail the entire rule? 

 

Check the underlying variable formula and use that as the expression (right side of the rule in your image above). 

 

Better yet, 

Provide a detailed description of the rule you are trying write and the requirement overall, that you are trying to achieve.

 

Also mention

NPrinting and Qlik SEnse (or QlikView version)

Is your report a Pixel Perfect, MS Office or HTML report?

Has it worked before or is this a new condition.

Have you successfully used conditions in the past or is this a first attempt?

 

For more information about NPrinting conditions, visit https://help.qlik.com/en-US/search/?q=conditions

 

Kind regards.

Please remember hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
colinodonnel
Creator II
Creator II
Author

Hi, 

The problem is how can a  Qlik Sense App owner trigger a nPrinting task i.e. an ad-hoc task run. The task will be to send an email with a HTML report in the body. For the moment, I am simply trying to get the email to send with this particular condition/trigger combination.

The app owner is not a developer. We have built the app for them.

For various reasons an nPrinting Task may need to be delayed, and the question is how can we give that "power" to the app owner to dictate when the next task run is. this is composed of both date and time. there will be option to change the time in 30 min increments e.g. change the next run time from 10 May 2023 15:00 to 10 May 2023 15:30.

The current proposed solution is:

Excel file on Sharepoint with a list of dates/times for the next scheduled tasks.

The next run time is fed into a variable in the Qlik app as a number.

This variable feeds into nPrinting.

nPrinting is triggered to run every 15 mins. 

A condition / rule is set-up in nPrinting to check the nPrinting system time against the variable value. If TRUE the nPrinting task runs. 

This works if  Variable = Constant.

However what I am trying to do use an Expression instead of a Constant i.e. Variable = Expression

No matter what I try as an Expression, with/without the equals sign, it will not work as a condition. The Expression is  = floor(now(),'1:00')

To improve the chance of both sides of the equation matching, both are rounded down to the nearest hour and the number of events in the trigger set to 1.

Help gratefully appreciated.

colinodonnel
Creator II
Creator II
Author

Hi Frank_S

Did you get a chance to review the response?

Thank you,

Colin

Frank_S
Support
Support

I think I understand your question but I could be wrong. Let me give this a shot.

Requirement: You want to enable a user that owns a Qlik Sense app to execute an NPrinting Publish Task

Is this correct?

If so, I would rather suggest that to do this by creating a QVF app that contains Nprinting API's such as the app attached.

You will need to be a programmer or have a programmer on your team to configure the API in the load script found in the app attached if you need further customization.

You can use built in qlik rest get and post connections

https://community.qlik.com/t5/Official-Support-Articles/How-to-create-NPrinting-GET-and-POST-REST-co...

Then enable the user to perform an app reload for this dedicated Publish task reload app from the Qlik Sense hub.

Now  to enable reloads of an app from the hub, you will need to have Qlik Sense version August 2022  or higher and configure reload availability in the Qlik Sense hub.

https://help.qlik.com/en-US/sense-admin/February2023/Subsystems/DeployAdministerQSE/Content/Sense_De...

For more information on NP APIs see the following links:

https://help.qlik.com/en-US/nprinting/May2022/Content/NPrinting/Extending/NPrintingAPI-Getting-Start...

https://help.qlik.com/en-US/nprinting/May2022/Content/NPrinting/Extending/NPrinting-APIs-Reference-R...

Hope this helps!

Please remember hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi

I think we are overcomplicating this. There are 2 solutions Fully automated and manual

1. We can use task chaining as @Frank_S mentioned and it is very easy to set it up (10 min job). In addition to all the steps he provided I supply NPrinting.qvs which is basically set of ready to use, "baby-simple" Qlik View/Sense script precedures which can be used to simplify the Qlik Sense app, which will be used as trigger: https://nprintingadventures.com/2019/04/08/nprinting-api-qlik-rest-subroutines/

or

2. As far as I understand it is a matter of allowing a user to trigger particular task manually. Why dont you just create a special role for that user to be able to access NPrinting admin console, see only that app and run publish task from directly from there? 

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.
colinodonnel
Creator II
Creator II
Author

Hi both,

Thank you for your responses.

Yes in effect it is a manual solution.

The end user has the control as to when the nPrinting task is run.

Both of the solutions above require admin rights, which unfortunately is not in my gift. I had this issue before with "Import Task" when trying to import a list of email address for nPrinting. Admin access was not granted. Instead I rolled the email address into a variable in Qlik and that works fine -> although some email address have a single quote mark in them which was an interesting challenge.

Going back to the original ask....

1: is it possible to evaluate the expression in the box above? In qlik its straight-forward, just use a chart such as a "text and image" and see the result.  In nPrinting, I do not know if the expression is being evaluated as i require.

2:  When is the data transferred from the Qlik app to the nPrinting console i.e. such as a variable value? Is it only when the connection is refreshed? 

 

thank you

 

 

 

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi @colinodonnel 

no, I was not talking about admin rights. I was talking about dedicated role/permissions for your requirements which I dont see problem with as it falls under different criteria than import task: 

Lech_Miszkiewicz_0-1683881021703.png

Regarding your questions:

  1. There is no way to preview expression evaluation in NPrinting, but...
    1. I think one of your components is not working properly and I think it is not expression. It is likely to be the other end which I assume is a variable and which may not expand as explained here: https://help.qlik.com/en-US/nprinting/May2022/Content/NPrinting/Troubleshooting/Variables-dont-expan...
      1. Is your variable set to numerical value in load script?
      2. Or is it UI variable with formula in it which in that case should have formula starting with "=" sign as mentioned in link above. 
      3. Try to set it to something simple like '=Floor(Today())' on one end and then do =Floor(Today()-1) on another end to test if it works

 

I would encourage you to expose the variable you are trying to use in your condition in a report. 

When it comes to second question "When is the data transferred from the Qlik app to the nPrinting console i.e. such as a variable value? Is it only when the connection is refreshed?" normally you wouldn't need to regenerate metadata as variables and data should be updated as soon as app is updated and in Qlik sense memory. 

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.
colinodonnel
Creator II
Creator II
Author

Hi @Lech_Miszkiewicz 

Suggestion number 3 worked 🙂

Now that i have confidence in the process, it can be refined... and the end user can control the process via MS Teams. There are a number of files for the app in there, so it keeps things simple for them.

The "recipe" is as follows:

In the Qlik Variable UI, a variable was created like this:

colinodonnel_0-1683884070610.png

 

In nPrinting, under Conditions >> Rules, this was added

colinodonnel_1-1683884134078.png

A Task trigger was set-up, to run every min, but to End when Event Count is 1.

As suggested, the variable was added to the body of the email to test

colinodonnel_2-1683884191206.png