Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

brucemeyers
New 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
Partner
Partner

Re: Multiple step expression

 

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

5 Replies
Partner
Partner

Re: Multiple step expression

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

 

Partner
Partner

Re: Multiple step expression

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

Partner
Partner

Re: Multiple step expression

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
New Contributor II

Re: Multiple step expression

Logic:

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

Partner
Partner

Re: Multiple step expression

 

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