Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

how to use sum multiple field value

Hi,

I have requirement where I want to fetch more then one field value in to single expression.

In below mention example there is more then one division and for each division value stored on there respacted field.

I have tired single statement and found result is correct.

=sum({$<DIVISION ={'L'}>} GROSSWT)

But when I am using OR I am getting -1 as value.

=sum({$<DIVISION={'L'}> GROSSWT) OR sum({$<DIVISION ={'D'}>} PCS)

So now I am not sure my method of using OR is correct ?

Tags (1)
3 Replies

Re: how to use sum where there is multiple selection

Check with this

=sum({$<DIVISION={'L'}> GROSSWT) +sum({$<DIVISION ={'D'}>} PCS)

or

=RangeSum(sum({$<DIVISION={'L'}> GROSSWT) , sum({$<DIVISION ={'D'}>} PCS))


Re: how to use sum where there is multiple selection

Hi

Try like this

=Alt(sum({$<DIVISION={'L'}> GROSSWT),0) + Alt(sum({$<DIVISION ={'D'}>} PCS),0)

Alt() function used because, if

sum({$<DIVISION={'L'}> GROSSWT) OR sum({$<DIVISION ={'D'}>} PCS) is null values means, may be null appear..

i.e. '-' (null value) +  45 gives null value.. to avoid this alt() function used here..

or

try like this

Rangesum(sum({$<DIVISION={'L'}> GROSSWT),

sum({$<DIVISION ={'D'}>} PCS))

Hope it helps

Vegar
Valued Contributor II

Re: how to use sum where there is multiple selection

Your -1 = TRUE stating that Expression 1 OR Expression 2 are TRUE.

Not sure what you want to accomplish, but maybe this is what you want to do:

sum({$<DIVISION={'L'}> GROSSWT) + sum({$<DIVISION ={'D'}>} PCS)

Best regards

Vegar Lie Arntsen

QlikView consultant at egbs consulting ab http://egbs.se

Blog (in Swedish): http://bi-effekten.se

Please ekskuse my Norglish and Swenglish typos.
Community Browser