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

Announcements
Posting on Qlik Community is temporarily paused. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
upaliwije
Creator II
Creator II

Ratio issue

I have following Pivot table in my documnet

 

SITUATION 1
DESCRIPTIONACTUALACT_RATIO
INCOME2,665,244,812100
EXPENSES256,525,52410
SITUATION 2
LOCATIONDEPT 1DEPT 2DEPT 3
DESCRIPTIONACTUALACT_RATIOACTUALACT_RATIOACTUALACT_RATIO
INCOME1,278,071,01448866,770,07933520,403,71920
EXPENSES108,549,183472,843,841375,132,5003

Under situation 1  when I divide the expenses from income i get the correct ratio of 10%

but under situation 2 when I do the same after adding Dept dimension I get a incorrect ratio

Ratio result I am expecting should as give below

       

SITUATION 2
LOCATIONDEPT 1DEPT 2DEPT 3
DESCRIPTIONACTUALACT_RATIOACTUALACT_RATIOACTUALACT_RATIO
INCONME1,278,071,014100866,770,079100520,403,719100
EXPENSES108,549,183872,843,841875,132,50014

My expression is =fabs((Sum(ACTUAL)/$(=$(=vActual))*100))

pls help me get correct results from Oivot table

Labels (1)
1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

Sorry after your last reply, I was outside and not having computer..

Use below expression...

=fabs((Sum(ACTUAL)/SUM(TOTAL <LOCATION> {<DESCRIPTION = {'GROSS_PREMIUM'}>}ACTUAL)*100))

View solution in original post

13 Replies
MK_QSL
MVP
MVP

Use

SUM(ACTUAL)/SUM(TOTAL <LOCATION> ACTUAL)

upaliwije
Creator II
Creator II
Author

Tks

How can I modify my expression (=fabs((Sum(ACTUAL)/$(=$(=vActual))*100)))with location

MK_QSL
MVP
MVP

What is the expression for vActual?

upaliwije
Creator II
Creator II
Author

I have created a variable for income as follows

vActual=sum({$<DESCRIPTION={'INCOME'}>}ACTUAL)

MK_QSL
MVP
MVP

change it to

SUM(TOTAL <LOCATION> {<DESCRIPTION = {'INCOME'}>}ACTUAL)

upaliwije
Creator II
Creator II
Author

I have done it still the result is like this

LOCATIONDEPT 1DEPT 2DEPT 3
DESCRIPTIONACTUALACT_RATIOACTUALACT_RATIOACTUALACT_RATIO
INCOME1,278,071,01448866,770,07933520,403,71920
EXPENSES108,549,183472,843,841375,132,5003
MK_QSL
MVP
MVP

Provide sample app

upaliwije
Creator II
Creator II
Author

I m attaching a sampal file  pls

MK_QSL
MVP
MVP

Can you provide the expected result in excel file?

This file having different figure than original question