Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Customer & Partners, DEC. 9, 11 AM ET: Qlik Product & Strategy Roadmap Session: Data Analytics REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
dafnis14
Specialist
Specialist

TOTAL and * in expression

Hi,

The following expression doesn't work for me:

sum( Qty*Carts_Per_Item) /

sum(TOTAL <Style> Qty*Carts_Per_Item)

Any idea why?

Thanks!

1 Solution

Accepted Solutions
sunny_talwar

Try this

SUM(TOTAL <A> SUM)/

SUM(TOTAL SUM)

Capture.PNG

View solution in original post

16 Replies
sunny_talwar

Would you be able to post a sample?

Miguel_Angel_Baeyens

What do you mean by "it does not work"? Syntax seems to be OK, if it does not return the results you expect then as Sunny suggests post some sample data and expected results.

Are Qty and Carts_Per_Item fields in the same table?

dafnis14
Specialist
Specialist
Author

Will try..Thanks!

dafnis14
Specialist
Specialist
Author

Hi,

My issue is somewhere else:

I would like to have the relative quantity by dim A,

or share of A

SUM(SUM)/ SUM(TOTAL <A> SUM)

A B Qty % Total by A
159413 100.00% 100%
ClBold 1146609.20%28%
ClRegular 13736223.44%72%
FlMint81385.10%26%
FlSmooth102226.41%33%
FlSummer124187.79%40%
MeBold1735210.88%23%
MeRegular5293933.21%69%
MeSmooth63223.97%8%

Desired number:

Cl5202232.63%
Fl3077819.31%
Me7661348.06%

What am i doing wrong??

Thanks!

sunny_talwar

May be you need this

Sum(SUM)/Sum(TOTAL SUM)

dafnis14
Specialist
Specialist
Author

Hi,

Yes, in my original model the 2 fields are in different table.

Could that cause an issue?

I simplified it just to check in the above data (sum by dim A), but it doesn't work either,,

Thanks!

dafnis14
Specialist
Specialist
Author

No, it gives the same result as the % column..

dafnis14
Specialist
Specialist
Author

Just Attached the data..

sunny_talwar

This is what you want to get, right?

Capture.PNG

I guess create a chart with

Dimension

A

Expression

Sum(SUM)

Sum(SUM)/Sum(TOTAL SUM)

This doesn't give you what you want, really?