Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calc of % in Dimension

Hi everyone.

I have a script in my model that should calculate the "%" = "Debt1/Debt Total" and this  "%" should be included as a dimension next to "Debt1" and "Debt Total", but I can't make that the code realice the division. Please, could you help me?

Attached is the example model with the script.

Thanks

5 Replies
sunny_talwar

I am not exactly sure what you are looking for... Would you be able to point out where exactly are we looking?

Best,

Sunny

Not applicable
Author

I need that table in Page "Weekly AR by Area" (my example model is attached in main message) does the correct calculation of %over 14 and %over 180.

Taking Chile as example, now I have this:

and I should have this (can you see the error in %over 14 and %over 180?:

   

TW_VarAreaSubArea201701201652201651201650201649
Account ReceivableCHILECHILE4,7574,7574,7574,7574,757
Account ReceivableGrand Total 4,7574,7574,7574,7574,757
Over 14 DaysCHILECHILE4,3654,3654,3654,3654,365
Over 14 DaysGrand Total 4,3654,3654,3654,3654,365
Over 180 DaysCHILECHILE1,2711,2711,2711,2711,271
Over 180 DaysGrand Total 1,2711,2711,2711,2711,271
%Over 14 DaysCHILECHILE91.7591.7591.7591.7591.75
%Over 14 DaysGrand Total 91.7591.7591.7591.7591.75
%Over 180 DaysCHILECHILE26.7226.7226.7226.7226.72
%Over 180 DaysGrand Total 2727272727
Not applicable
Author

The calculations of % are OK, but the problem occurs when I drill up into the dimensions because at customer level the % is OK, but when I check by country the % of country is the sum of % of customer and should by a calculation not sum...

sunny_talwar

How are you getting this 91.75 number? and 26.72? I am trying to understand the logic behind this.... Are you looking for a change in the script or on the front end? or are you looking to apply a totally new approach? I guess I am still trying to figure out your requirement

Not applicable
Author

Do you review my script?, in the tab "Tabla1" is the calculation of every "variable". The calculation at bottom level is OK, my problem is when aggregate the Variable dimension, because most of your values are summarized but I have these 2 "variable": "% over 14" and "% over 180" which aggregate calculation is not sum(), these should be apply the formula of the script for their aggregation.

Am I clear?

Attached in the mail mesage is my example model with script included.

thanks !