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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Expression conditioned by 2 dimensions

Hi everyone,

I have created this chart to view the share of a given dimension (Sales Vendor) that works well :

Sum( {<[Sales Vendor]={B}>}Volume)/Sum (Volume)

However, I am trying to to view the share of (Sales Vendor) conditioned by another dimension (Products). I am trying the following expression but it does not display the correct %:

Sum(  {<[Sales Vendor]={B}>} {<products={Apple}>}  Volume) / Sum ({<Products={Apple}>} Volume)

The expression must be wrong as I have listed the 2 dimensions conditions side by side . I am sure there is a way to combine these dimensions so that they display the correct market share . The correct market share that should be displayed in red is in the XCL attached .


Thank you very much for your help,

Julien

Labels (1)
1 Solution

Accepted Solutions
DavidFoster1
Specialist
Specialist

Sorry another error. I typed products instead of Products. Again original posting has been corrected. I checked this in your qvw and it works now.

View solution in original post

6 Replies
DavidFoster1
Specialist
Specialist

try:

Sum(  {$<[Sales Vendor]={B}, Products={Apple}>}  Volume) / Sum ({$<Products={Apple}>} Volume)

Not applicable
Author

Hi David,

Thank you for your help.

However I have applied your expression and even though the shares get closer to what they should be, it's still does not display the correct shares - see attached. (red line should be between 2 and 14%)

Thank you for helping me,

Julien

DavidFoster1
Specialist
Specialist

Sorry there is an error. The $ symbol in the second sum should be inside the { brace. I have corrected my original post.

Not applicable
Author

Hi David,


Actually, I already did put the $ inside the { bracket :

Sum(  {$<[Sales Vendor]={B}, products={Apple}>}  Volume) / Sum ( {$<Products={Apple}>} Volume)

But still , it returned the wrong formulas - as per the screenshot above.

I have reattached the QV project updated with your formula but it does not work unfortunately .

Do you know what could have gone wrong ?


Thank you,

Julien

DavidFoster1
Specialist
Specialist

Sorry another error. I typed products instead of Products. Again original posting has been corrected. I checked this in your qvw and it works now.

Not applicable
Author

Yes it worked ! Perfect, thank you very much David !