Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
brucemeyers
Contributor II
Contributor II

Multiple step expression

I want to make the expression below perform these calculations

 

Sum the [Costs] of the [Soup Brand] field containing ‘Whole Foods’

-

Sum the [Costs] of the [Soup Brand] field containing ‘Nissin Cup Noodles’, ‘Health Valley’, and ‘Healthy Choice’

-

Sum the [Costs] of the [Soup Brand] field containing ‘Campbells’ and ‘Progresso’

 

Here is what I have come up with but I need help

 

Sum({1<[ Soup Brand]={'Whole Foods '}>  -

 

1<[ Soup Brand]={'Nissin Cup Noodles '}> + 1<[ Soup Brand]={'Health Valley '}> + 1<[ Soup Brand]={'Healthy Choice '}>  -

 

1<[ Soup Brand]={'Campbells '}> + 1<[ Soup Brand]={' Progresso '}>

 

}  [Cost])

1 Solution

Accepted Solutions
MohammedMustaq
Partner - Creator
Partner - Creator

 

Try this:

 

=Sum({<[Soup Brand]={'Whole Foods'}>}[Cost])

-Sum({<[Soup Brand]={'Health Valley','Healthy Choice','Nissin Cup Noodles'}>}[Cost])

-Sum({<[Soup Brand] ={'Progresso','Campbells'}>}[Cost])

 

Thanks

View solution in original post

5 Replies
MohammedMustaq
Partner - Creator
Partner - Creator

Try this:

 

=(Sum({<[Soup Brand]={'Whole Foods'}>}[Cost])-Sum({<[Soup Brand]={'Nissin Cup Noodles'}>}[Cost])
+Sum({<[Soup Brand]={'Health Valley','Healthy Choice'}>} [Cost])
-Sum({<[Soup Brand]={'Campbells'}>}[Cost])+ Sum({<[Soup Brand]={'Progresso'}>}[Cost]))

 

Regards

Mohammmed Mustaq

 

shitijar
Partner - Contributor
Partner - Contributor

Hi,

Instead of writing three different expressions of Soup brands you can club it in one single expression right.

1<[ Soup Brand]={'Nissin Cup Noodles ', 'Health Valley ', 'Healthy Choice '}>

 

Thanks,

Shetty

MohammedMustaq
Partner - Creator
Partner - Creator

I hope i understand your requirement.

With Your Set Analysis Expression:

 

 

=(Sum({<[ Soup Brand]={'Whole Foods','Health Valley','Healthy Choice','Progresso'}>} [Cost])

-Sum({<[ Soup Brand]={'Nissin Cup Noodles','Campbells'}>} [Cost]))

 

Logic:

Whole Foods+Healthy Valley+Healthy Choice+Progresso -Nissin Cup Noodles and Campbells

 

 

 

 

brucemeyers
Contributor II
Contributor II
Author

Logic:

Sum(Whole Foods) - Sum(Healthy Valley+Healthy Choice+Nissin Cup Noodles) - Sum (Progresso + Campbells)

MohammedMustaq
Partner - Creator
Partner - Creator

 

Try this:

 

=Sum({<[Soup Brand]={'Whole Foods'}>}[Cost])

-Sum({<[Soup Brand]={'Health Valley','Healthy Choice','Nissin Cup Noodles'}>}[Cost])

-Sum({<[Soup Brand] ={'Progresso','Campbells'}>}[Cost])

 

Thanks