Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
MK_QSL
MVP
MVP

Set Analysis

Using below set expression, I am getting the correct result...

Just want to know, is there any merged/shorter version of this expression possible?

=SUM({<Brand = {'B1','B2'}, Type = {1}>}Sales)

+

SUM({<Brand = {'B3'}, Type = {3}>}Sales)

+

SUM({<Brand = {'B4'}, Type = {2}>}Sales)

1 Solution

Accepted Solutions
tresesco
MVP
MVP

This?

=SUM({<Brand = {'B1','B2'}, Type = {1}> + <Brand = {'B3'}, Type = {3}> + <Brand = {'B4'}, Type = {2}>}Sales)

View solution in original post

8 Replies
Not applicable

Hi,

U can try this one

=Sum( {<Brand = {'B1','B2'}, Type = {1}>  + <Brand = {'B3'}, Type = {3}>+<Brand = {'B4'}, Type = {2}> } Sales)


Regards,

Vivek

kalyandg
Partner - Creator III
Partner - Creator III

hi Manish,

you can try this

=sum({<Brand={'B1', 'B2', 'B3', 'B4'}, Type={'1','2','3'}>}sales)

Best Regards,

Kalyan.D

tresesco
MVP
MVP

This?

=SUM({<Brand = {'B1','B2'}, Type = {1}> + <Brand = {'B3'}, Type = {3}> + <Brand = {'B4'}, Type = {2}>}Sales)

MK_QSL
MVP
MVP
Author

So Simple... How come I haven't think about it?

MK_QSL
MVP
MVP
Author

What if ?

=SUM({<Country = {'UK'}, Brand = {'B1','B2'}, Type = {1}>}Sales)

+

SUM({<Country = {'UK'}, Brand = {'B3'}, Type = {3}>}Sales)

+

SUM({<Country = {'UK'}, Brand = {'B4'}, Type = {2}>}Sales)


Question is Can we make Country = {'UK'} common or need to mention everywhere

tresesco
MVP
MVP

May be this?

=SUM({<Country = {'UK'}>* (<Brand = {'B1','B2'}, Type = {1}>+ <Brand = {'B3'}, Type = {3}>+< Brand = {'B4'}, Type = {2}>)>} Sales)

MK_QSL
MVP
MVP
Author

Giving syntax error!

tresesco
MVP
MVP

This?

=SUM({<Country = {'UK'}>* (<Brand = {'B1','B2'}, Type = {1}>+ <Brand = {'B3'}, Type = {3}>+< Brand = {'B4'}, Type = {2}>)} Sales)

Removed an extra '>'