Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
jjking58
Contributor III
Contributor III

List Box conditioning

Can someone explain how to condition a list box from showing amounts that are zero or null.

I coded the following under the General-->Field --> Expression

=if(aggr(sum({<IDPAGR={'PART','MECH','CAFE','OCSE','COOL'},NOAGRP-={'INTR'}>}Amount)+

         sum({<IDPAGR={'EQUP'},OrderType-={'TI'},NOAGRP-={'INTR'}>}Amount)+

         sum({<IDPAGR={'LABO','INST'},OrderType-={'SR'},NOAGRP-={'INTR'}>}Amount),NANAME)<=0,0,

       NANAME&' '&sum({<IDPAGR={'PART','MECH','CAFE','OCSE','COOL'},NOAGRP-={'INTR'}>}Amount)+

         sum({<IDPAGR={'EQUP'},OrderType-={'TI'},NOAGRP-={'INTR'}>}Amount)+

         sum({<IDPAGR={'LABO','INST'},OrderType-={'SR'},NOAGRP-={'INTR'}>}Amount))

I would like the NANAME(customer) field along with the Amount to show if the Amount is not zero or null

Also do i need anything under the expression tab?

My result looks like this

Capture2.PNG

Thanks in advance

Jim

1 Solution

Accepted Solutions
sunny_talwar

Sorry, I missed the ending part of the set analysis (>})... Try this:

Aggr(Only({1<NANAME = {"=Sum({<IDPAGR={'PART','MECH','CAFE','OCSE','COOL'}, NOAGRP-={'INTR'}>} Amount) + Sum({<IDPAGR={'EQUP'}, OrderType-={'TI'}, NOAGRP-={'INTR'}>} Amount) +Sum({<IDPAGR={'LABO','INST'}, OrderType-={'SR'}, NOAGRP-={'INTR'}>} Amount) > 0"}>} NANAME), NANAME)

View solution in original post

7 Replies
sunny_talwar

Use this on the General tab

Aggr(Only({1<NANAME = {"=Sum({<IDPAGR={'PART','MECH','CAFE','OCSE','COOL'},NOAGRP-={'INTR'}>}Amount) + Sum({<IDPAGR={'EQUP'},OrderType-={'TI'},NOAGRP-={'INTR'}>}Amount) + Sum({<IDPAGR={'LABO','INST'},OrderType-={'SR'},NOAGRP-={'INTR'}>}Amount) > 0"} NANAME), NANAME)

and then on the expression tab, try this

=Sum({<IDPAGR={'PART','MECH','CAFE','OCSE','COOL'},NOAGRP-={'INTR'}>}Amount) + Sum({<IDPAGR={'EQUP'},OrderType-={'TI'},NOAGRP-={'INTR'}>}Amount) + Sum({<IDPAGR={'LABO','INST'},OrderType-={'SR'},NOAGRP-={'INTR'}>}Amount)

jjking58
Contributor III
Contributor III
Author

Sunny

Now only the header of the list box shows.

sunny_talwar

Keeping the Sum() aside some a little bit, this as your list box expression on the general tab doesn't work?

Aggr(Only({1<NANAME = {"=Sum({<IDPAGR={'PART','MECH','CAFE','OCSE','COOL'}, NOAGRP-={'INTR'}>} Amount) + Sum({<IDPAGR={'EQUP'}, OrderType-={'TI'}, NOAGRP-={'INTR'}>} Amount) +Sum({<IDPAGR={'LABO','INST'}, OrderType-={'SR'}, NOAGRP-={'INTR'}>} Amount) > 0"} NANAME), NANAME)

jjking58
Contributor III
Contributor III
Author

Sorry i'm not sure what your asking. This is were i put the code and the result is on the rightCapture3.PNG

sunny_talwar

Sorry, I missed the ending part of the set analysis (>})... Try this:

Aggr(Only({1<NANAME = {"=Sum({<IDPAGR={'PART','MECH','CAFE','OCSE','COOL'}, NOAGRP-={'INTR'}>} Amount) + Sum({<IDPAGR={'EQUP'}, OrderType-={'TI'}, NOAGRP-={'INTR'}>} Amount) +Sum({<IDPAGR={'LABO','INST'}, OrderType-={'SR'}, NOAGRP-={'INTR'}>} Amount) > 0"}>} NANAME), NANAME)

jjking58
Contributor III
Contributor III
Author

That was it.

Thanks for your help it was greatly appreciated

Jim

sunny_talwar

Please close the thread by marking the correct response.

Qlik Community Tip: Marking Replies as Correct or Helpful

Best,

Sunny