Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Total row Straight table Percentage% calculation

Hello,

I have the below in my application, its a straight table and i am displaying the Top 10 values for Groups.

And the Total row should display the Top 10 Sum values for the YTD, PY YTD, Var and Var%.

I can use Sum of Rows for the first 3 columns, but not for the % column which will give me the wrong result. I tried using the expression total, but not right result. Any suggestion would be helpful.

Thanks.

    

GroupSales YTDPY YTDVarVar%
LLL419,439,519537,374,285-117,934,766-28.1%
HHH744,339,937858,384,914-114,044,977-15.3%
SSS338,613,157441,800,776-103,187,619-30.5%
AAA241,717,161344,476,279-102,759,118-42.5%
CCC388,151,255470,200,691-82,049,436-21.1%
HSHS275,213,194309,458,551-34,245,357-12.4%
VVV81,173,492113,489,048-32,315,556-39.8%
SYSYSY56,938,90083,504,770-26,565,870-46.7%
MOOR229,326,613252,359,634-23,033,021-10.0%
SSWRT75,485,12596,555,761-21,070,636-27.9%
Top 10 Total2,850,398,3523,507,604,710-657,206,358
6 Replies
antoniotiman
Master III
Master III

Try

If(Dimensionality() = 0,
(Sum(TOTAL SalesYTD)-Sum(TOTAL PYYTD))/(Sum(TOTAL SalesYTD
)),
(Sum(SalesYTD)-Sum(PYYTD))/(Sum(SalesYTD
)))

Regards,

Antonio

sunny_talwar

Would you be able to provide raw data behind the above output. I feel that it would be easier to propose something knowing how the data looks.

Not applicable
Author

Thanks for the reply Antonio, however i could not relate your reply to my question.

Not applicable
Author

I might not be able to share the Raw data here, but can tell you that, it is daily transaction data and i am calculating YTD and PY YTD using set analysis. Please let me know what kind of information you are looking for.

Not applicable
Author

I have understood your suggestion now, took some time and research to get a clear picture

My problem here is that I have restricted the values displayed to the first 10 using Dimension Limits, so using TOTAL will get the overall value and not for the 10 values displayed. Is there a way to relate the TOTAL with the values displayed?

Not applicable
Author

Thanks Antonio

I was just looking for this!!

Awesome