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

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Dimensions level difference in pivot table.

Dear All,

I have dimension field as "Type" under this two categories Actual and Proposed. Now I want to get difference Proposed  v Actual  in pivot talbe.

I am unable to do it. can we do it ? if so please let me know.

sample  QVW file attached herewith for your reference.

Regrads

UG

9 Replies
vijay_iitkgp
Partner - Specialist
Partner - Specialist

Hi,

You can use Sum(If(Type='Proposed',Amount))-Sum(Type='Actual',Amount)

vijay_iitkgp
Partner - Specialist
Partner - Specialist

Srry..

Sum(If(Type='Proposed',Amount)) -Sum(If(Type=Actual,Amount))

vijay_iitkgp
Partner - Specialist
Partner - Specialist

Or if want to use set analysis then:

=Sum({$<Type={'Proposed'}>} Amount) - Sum({$<Type={'Actual'}>} Amount)

Not applicable
Author

Dear Mr. Vijay,

Thanks for prompt reply.But actually I want data in following format.

TypeActualProposedDifference
Vol567.98021.270-546.710
InvPrice4,909.204,400.00-509.20
Excise398.64357.31-41.33
VAT640.33573.95-66.38
CST0.000.000.00
Freight846.30846.300.00
Unloding0.000.000.00
NCR3,023.932,622.44-401.50

Regares,

UMESH

vijay_iitkgp
Partner - Specialist
Partner - Specialist

Then Split the expression... 

Use 1st part for Proposed

2nd Part for Actual

and complete for difference

Not applicable
Author

you can apply expression in pivot table as:

sum(proposed) - sum(actual).

vijay_iitkgp
Partner - Specialist
Partner - Specialist

Vijit,

I think you overlooked the requirement.Proposed and Actuals are category not the amount. ...

Not applicable
Author

you can't apply this type of expression in pivot table as you have to apply expression differently for vol, invPrice etc.

so apply it in text object and place it in front of your pivot table:

expn.

= if(type = 'proposed', sum(vol)) - if(type = 'actual', sum(vol))

note: similarly for invPrice etc.

Not applicable
Author

Hi Umesh,

Did you find solution to your problem? I'm experiencing the same issue. If you have a solution please share.

Thanks,

Grif