Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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.

jenmclean
New Contributor III

Not return 0 values

How would I write this expression so that it will only show values that are greater than 0?

(Sum({$<PARTS|SubTypeDesc-={'NATIONAL ACCOUNTS PART', 'NATIONAL ACCOUNTS BATTERY', 'NET STATE'}, PARTS|ActiveFlag={1}>}PARTS|OnHandInv)=0, Null(), (PARTS|OnHandInv-PARTS|Obligated-PARTS|KeepOnHand))

4 Replies
eduardo_sommer
Valued Contributor

Re: Not return 0 values

Try

if((Sum({$<PARTS|SubTypeDesc-={'NATIONAL ACCOUNTS PART', 'NATIONAL ACCOUNTS BATTERY', 'NET STATE'}, PARTS|ActiveFlag={1}>}PARTS|OnHandInv)=0, Null(), (PARTS|OnHandInv-PARTS|Obligated-PARTS|KeepOnHand))> 0,

(Sum({$<PARTS|SubTypeDesc-={'NATIONAL ACCOUNTS PART', 'NATIONAL ACCOUNTS BATTERY', 'NET STATE'}, PARTS|ActiveFlag={1}>}PARTS|OnHandInv)=0, Null(), (PARTS|OnHandInv-PARTS|Obligated-PARTS|KeepOnHand)))


if the result is 0 or less, the expression will return a null value


Eduardo

preminqlik
Valued Contributor II

Re: Not return 0 values

hi there try  this

(Sum({$<PARTS|SubTypeDesc-={'NATIONAL ACCOUNTS PART', 'NATIONAL ACCOUNTS BATTERY', 'NET STATE'}*{'=(Sum({$<PARTS|SubTypeDesc-={'NATIONAL ACCOUNTS PART', 'NATIONAL ACCOUNTS BATTERY', 'NET STATE'}, PARTS|ActiveFlag={1}>}PARTS|OnHandInv)=0, Null(), (PARTS|OnHandInv-PARTS|Obligated-PARTS|KeepOnHand))>0'}, PARTS|ActiveFlag={1}>}PARTS|OnHandInv)=0, Null(), (PARTS|OnHandInv-PARTS|Obligated-PARTS|KeepOnHand))

jenmclean
New Contributor III

Re: Not return 0 values

Clarifiying, I need it to only display results that are postive or negative and NOT 0.

eduardo_sommer
Valued Contributor

Re: Not return 0 values

Just change the >0 to <>0 in my earlier suggestion (in the end of second line)

Eduardo