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

How to add calculated percentage based on the above rows

The following is the pivot table that I've generated which contains only two rows of sales.

I tried to add a third row to display the ratio of the sale, say $54,508.35/$38,874.04-1 which will give me 40.22%. If possible, it will ideally showing as following. (I've made the following pictures from EXCEL.)

But other than showing the Total of the sale, couldn't figure how

1. how to add this extra row

2. how to put the calculated values.

Please help.

1 Solution

Accepted Solutions
Gysbert_Wassenaar

See attached qvw.


talk is cheap, supply exceeds demand

View solution in original post

6 Replies
Gysbert_Wassenaar

You can try using the dimensionality() function. Something like:

=if(dimensionality()=0, firstsortedvalue(aggr(sum(Sales),Territory,[Weekend Ending])),[Weekend Ending])/ firstsortedvalue(aggr(sum(Sales),Territory,[Weekend Ending])),-[Weekend Ending]),sum(Sales))


talk is cheap, supply exceeds demand
Not applicable
Author

Thank you very much for your reply.

Sales here is not Dimension. Only Territory and Weekend are. The firstsortedvalue didn't work on the expressions. Or I misused it?

Gysbert_Wassenaar

No idea. Can you post a sample document with some data? See this document for how to do that safely: Preparing examples for Upload - Reduction and Data Scrambling


talk is cheap, supply exceeds demand
Not applicable
Author

Please see attached qvw file. Thank you very much for your time.

Gysbert_Wassenaar

See attached qvw.


talk is cheap, supply exceeds demand
Not applicable
Author

Oh my! You saved my day. Thank you.