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

Variables doesn't generate results in charts, but only shows up as the variable itself. (incorrect variable definition?)

Hi,

I defined a simple variable (vCurrentYear) in a Qlik sense app, which I connected to my NPrinting report.

(Value of this variable is "2024")

I successfully added this within the Nprinting Designer.

When I want to create a chart with this, no matter which notation I try, I always get the variable definition itself, but not the value as output.

I tried:
'=$(vCurrentYear) (Excel doesn't accept it without ')

'=(vCurrentYear)

'(vCurrentYear)

'vCurrentYear

What do I do wrong? In the Qlik Sense Table, when I use =vCurrentYear as expression for the label, it shows up as 2024.

Any more information needed? Please let me know!

 

Labels (1)
1 Solution

Accepted Solutions
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi @Moritz 

in your last comment there are few words which change everything!!! You said: "Here's how the excel spreadsheet look like, which serves for the powerpoint chart:". That is a perfect example of how important is to provide detailed explanation of the problem 🙂

  • We never knew you were talking about native PowePoint chart
  • Excel table embedded in power point template has very limited capabilities and formulas and variable will not work in it. You can only get data from the table in it - dynamic labels also will not work in it.

Workaround - I know it is not great but:

  • dont worry about creting labels for the legend in fact you can just leave them empty and disable chart legend
  • make background of the chart transparent
  • make legend labels seperately as power point labels and since your chart will be transparent
  • you can put current and last year formula or variable directly as individual independent objects and use █ or ■ characters to represent bars and colour them as you need so they can mimic legend

Lech_Miszkiewicz_0-1706656508054.png

 

cheers

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

7 Replies
Frank_S
Support
Support

I've tested the following and it works fine.
If the syntax is not right in Qlik Sense, it will not work in NPrinting as a variable filter.

 

Also if you use =(vCurrentYear) as a table column dimension, you'll need to create another another identical variable in Qlik Sense and use the duplicate as your NPrinting Variable.
For details see:

https://help.qlik.com/en-US/nprinting/May2023/Content/NPrinting/Troubleshooting/Variables-dont-expan...

 

Kind regards...
 

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 @Moritz 

Franks link sayis it all - if you refer to variable in Qlik as a lable then situation you describe is that variable will not expand in NPrinting as documented.

Workarounds:

  • change variable definition to allow for it to be expanded in Qlik
  • create NPrinting formula, put variable in it (just like you do in Qlik) and then use that instead. Formulas are passed to Qlik and work just like any other expression box in Qlik hence they will cause your variable to expand.

cheers

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

Hi @Frank_S and @Lech_Miszkiewicz 

thanks a lot for your responses already! Not sure if I follow completly, but it seems this isn't working from out of the box right?
So, I meanwhile have the variables in line in NPrinting and Qlik. here's the variable definition in Qlik sense (hard-coded without FX:)

Moritz_0-1706631658517.png

Here's how i set it up in the Nprinting template Editor (tried with variable as well as with formula.)

Moritz_3-1706631992910.png

 

The formular is configured as such:

Moritz_2-1706631971807.png

Here's how the excel spreadsheet look like, which serves for the powerpoint chart:

Moritz_4-1706632069051.png

 

and here's the powerpoint result:

Moritz_5-1706632161919.png

 

Any help highly appreciated!!!

 

 

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi @Moritz 

in your last comment there are few words which change everything!!! You said: "Here's how the excel spreadsheet look like, which serves for the powerpoint chart:". That is a perfect example of how important is to provide detailed explanation of the problem 🙂

  • We never knew you were talking about native PowePoint chart
  • Excel table embedded in power point template has very limited capabilities and formulas and variable will not work in it. You can only get data from the table in it - dynamic labels also will not work in it.

Workaround - I know it is not great but:

  • dont worry about creting labels for the legend in fact you can just leave them empty and disable chart legend
  • make background of the chart transparent
  • make legend labels seperately as power point labels and since your chart will be transparent
  • you can put current and last year formula or variable directly as individual independent objects and use █ or ■ characters to represent bars and colour them as you need so they can mimic legend

Lech_Miszkiewicz_0-1706656508054.png

 

cheers

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

Thanks so much @Lech_Miszkiewicz  and @Frank_S this worked fine with both of your help!

The workaround, separately including the legend as formula is brilliant!

 

Frank_S
Support
Support

Standing ovation for your elegant solution @Lech_Miszkiewicz

Happy to provide feedback @Moritz 

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

Thanks @Frank_S  - as you know it is always art of workarounds 😁

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.