Skip to main content

Qlik NPrinting

Discussion Board for collaboration on Qlik NPrinting.

cancel
Showing results for 
Search instead for 
Did you mean: 
jrl
Contributor II
Contributor II

NPrinting - Create formula which returns a string

I can't seem to create a formula in NPrinting that returns a string.  Every time I preview the template, the formula just shows "-".  Is there a specific function in QlikView/NPrinting that will allow the string to evaluate properly?

The specifics of the issue are:

- I have a variable called vReportingQuarter = "2019Q3".

- I'm attempting to convert the vReportingQuarter variable to a string like "September 30, 2019".

- I've attempted to build a formula like: =PICK(RIGHT(vReportingQuarter,1),"March","June","September","December"), but when I add this to the template, it just evaluates as "-"

Any help would be appreciated.

Labels (2)
1 Solution

Accepted Solutions
Ruggero_Piccoli
Support
Support

Hi,

Yes, Qlik NPrinting supports QlikView/Qlik Sense formulas that return strings. Formulas must return a single value, so a single string is ok.

In your case, did you test the formula in QlikView before to insert it into Qlik NPrinting? Qlik NPrinting doesn't evaluate the formulas, it send them to QlikView/Qlik Sense and wait for the results. 

I tested your formula in QlikView and I needed to modify it to 

=PICK(RIGHT(vReportingQuarter,1),'March','June','September','December')

in order to get the correct result in QlikView.

Best Regards,

Ruggero



Best Regards,
Ruggero
---------------------------------------------
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 with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.

View solution in original post

4 Replies
Ruggero_Piccoli
Support
Support

Hi,

Yes, Qlik NPrinting supports QlikView/Qlik Sense formulas that return strings. Formulas must return a single value, so a single string is ok.

In your case, did you test the formula in QlikView before to insert it into Qlik NPrinting? Qlik NPrinting doesn't evaluate the formulas, it send them to QlikView/Qlik Sense and wait for the results. 

I tested your formula in QlikView and I needed to modify it to 

=PICK(RIGHT(vReportingQuarter,1),'March','June','September','December')

in order to get the correct result in QlikView.

Best Regards,

Ruggero



Best Regards,
Ruggero
---------------------------------------------
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 with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.
afbraga1
Creator
Creator

Hello Jrl,

Why don't you code the expression as you want in QlikView and then just import to NPrinting?

Which type of report are you trying to build? Excel, Pixel Perfect, PowerPoint?

Best Regards,

André Braga

Lech_Miszkiewicz

Hi @jrl

 @Ruggero_Piccoli pointed you into right direction. The other factor why your formula may not work is the definition of your variable. What is it? Is the value set to 2019Q3 or is it a an expression which calcualtes and returns this value. In such case you would have to expand it using $ sign 

=PICK(RIGHT($(vReportingQuarter),1),'March','June','September','December')

 

hope this helps

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.
jrl
Contributor II
Contributor II
Author

Ugh!  Single quotes!  Of course.

Thank you.