# Qlik Sense App Development

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

## 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

## 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

## 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

## Re: Multiple step expression

I hope i understand your requirement.

=(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

New Contributor II

## Re: Multiple step expression

Logic:

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

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