Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
Highlighted
Contributor II

List Box Expression

How to write below if condition  as an expression in the list box ? which is working fine in straight table.

if(Item.STATUS='P',Item.STATUS,

IF(sum(DMND)>0,if(sum(ONHAND-DMND)<0,'A','S'),'P'))

Need some thing like this

cappp.PNG

1 Solution

Accepted Solutions
Highlighted
Esteemed Contributor III

Re: List Box Expression

What are the dimensions you used in your straight table? Just use those dimensions and add in your aggr() field in your list box expression and see? If not, share some sample data to look into.

View solution in original post

5 Replies
Highlighted
Esteemed Contributor III

Re: List Box Expression

Try:

= Aggr(if(Item.STATUS='P',Item.STATUS,

            IF(sum(DMND)>0,

                     if(sum(ONHAND-DMND)<0,'A','S'),'P')), Item.STATUS)

Highlighted
Contributor II

Re: List Box Expression

Vishwa,

It created a list box but it's giving wrong results when I filter according to logic it should select only A

Capture.PNG

Highlighted
Esteemed Contributor III

Re: List Box Expression

Can you share this sample to look into? can you also give a reason why only A should be coming?

Highlighted
Contributor II

Re: List Box Expression

created this field in straight table depending on active, slow and purge items as status using  expression

if(Item.STATUS='P',Item.STATUS,

IF(sum(DMND)>0,if(sum(ONHAND-DMND)<0,'A','S'),'P'))

which is working accurate according to numbers tested trying to get same status column as list box so that can use it as a filter

Highlighted
Esteemed Contributor III

Re: List Box Expression

What are the dimensions you used in your straight table? Just use those dimensions and add in your aggr() field in your list box expression and see? If not, share some sample data to look into.

View solution in original post