Qlik Community

Qlik NPrinting Discussions

Discussion Board for collaboration on Qlik NPrinting.

Announcements
QlikWorld online is next week! REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
gerald_lebret
Partner
Partner

using variables in nprinting

Hello,

I am having an issue with a report build through pixel perfect based on qlik sense data..

I have revenue and expenses account and I wanna know the percentage of each line vs the total revenue.

In Qlik Sense, i created a variable that calculates the total revenue.

I also created in nprinting, a level "TYPE" because I need to sort my accounts in different categories and this level has a sub level with the accounts.

I also created different detail report type level and another detail report right after with the account level to loop through each account from each type

Finally, I filter my type level with the categorie I want.

My issue and that nprinting works like a charm to get the amounts. However the percentage calculation does not work as if it would recalculate the result of the variable instead of using the value.

My variable vCA_N formula is 

-SUM({$ < TYPE={'VENTES'}, CAL.Exercice ={'$(V_EXERCICE)'}>}[solde])

I have tried to create a new variable in qlik sense using =$(vCA_N) or =$(=vCA_N) I have tried to recreate the same variable in Nprinting. Nothing works. Here is my result:

gerald_lebret_0-1633905787563.png

Can anyone please help me?

Thanks

Labels (2)
4 Replies
Lech_Miszkiewicz

Hi @gerald_lebret 

1. What results do you have in Qlik Sense - can you screenshot your Qlik Sense table which is used as a source?

2. What results do you get in Qlik Sense when you apply selections on "Compte" dimension. Using levels in Pixel Perfect will be equivalen of such selection being applied. I guess that is where your issue is. When you are nesting table in the level then expression is being calculated according to that level. As far as I know that is working as it should. 


You are not hardcoding a result-number in your variable , instead you are putting in it formula so it is normal it will be calculated each time selection state changes. Your comment here is correct - it is recalculating and it is is expected behaviour: However the percentage calculation does not work as if it would recalculate the result of the variable instead of using the value. 

I dont know exactly how you have built your whole table and what expressions you have used, but my approach would be to use set analysis in variable expression to ignore selections which are being applied as levels.

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.
gerald_lebret
Partner
Partner
Author

HI @Lech_Miszkiewicz ,

Thanks for your answer.

The result in QS is as expected, % are calculated correctly.

gerald_lebret_0-1633987636664.png

Isn't there a possibility as there is in QS, that is to store a value to reuse it later but without the frmula, we just want the value and not the whole calculation again?

Thanks

 

Lech_Miszkiewicz

No, there is no such option. Everything what you want to do can be done.

Based on what you have told us so far it is all working as designed. 

You said you have 2or 3 levels (hard to say without screenshot of the template)

  • First Level TYPE - that will work like filter in Qlik Sense applying selection on each value existing in TYPE field, therefore your results from inner levels will calculate according to that selection
  • The same will happen for your next level
    • So following the logic directly in Qlik Sense and selecting TYPE  = MATIERES and then Compte = 3010 you will not get a %46.74 but instead with those selections you will get 100% rigt? And this is how NPrinting works.

So with that in mind question is if you could build your report differently? I know you could do it but it is hard to explain everying as there is first work required in Qlik Sense and then little bit different approach in NPrinting.

Do you want to make a dummy Qlik Sense app and dummy nprinting report and attach it here so we can use it, make changes and then send it back to you? It will be important to explain how groupings need to work (totals) so we can take that into account when planning solution.

 

 

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.
gerald_lebret
Partner
Partner
Author

Thanks @Lech_Miszkiewicz , I ended up splitting my table in 4 different tables in Qlik Sense and then I created levels for each one of these table and it is working as I want it to.