Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

sskiggs1
New Contributor III

If statement set analysis in Listbox

I have this set analysis if statement:

=if(sum({<USE_DESC_TYPE={"Gross Requirements Amt"}>}PERIOD_VAL) >0, 'Yes', 'No')

It works perfectly in a text box. However, It will not work in a listbox, or multibox, or anything which will display it as a selection.

Any ideas?

Thanks.

1 Solution

Accepted Solutions
Chanty4u
Esteemed Contributor III

Re: If statement set analysis in Listbox

ok try

=aggr(if(sum({<USE_DESC_TYPE={"Gross Requirements Amt"}>}PERIOD_VAL) >0, 'Yes', 'No'),PERIOD_VAL)

8 Replies
MVP
MVP

Re: If statement set analysis in Listbox

Try adding 'total' like:

=if(sum(TOTAL {<USE_DESC_TYPE={"Gross Requirements Amt"}>}PERIOD_VAL) >0, 'Yes', 'No')

Chanty4u
Esteemed Contributor III

Re: If statement set analysis in Listbox

may be

=if(aggr(sum({<USE_DESC_TYPE={"Gross Requirements Amt"}>}PERIOD_VAL) >0, 'Yes', 'No'),PERIOD_VAL)

sskiggs1
New Contributor III

Re: If statement set analysis in Listbox

Only Returned 'Yes' and no 'No' even though there are results which fit under no

Highlighted
sskiggs1
New Contributor III

Re: If statement set analysis in Listbox

this displayed a blank list box

pooja_prabhu_n
Contributor III

Re: If statement set analysis in Listbox

Hi,

try creating in the script

T1:

Load * Inline [

USE_DESC_TYPE,PERIOD_VAL

Gross Requirements Amt,10000000

B,200000000

C,30000000

D,60700000

E,50000000

]

;



T2:

Join

load USE_DESC_TYPE,

if(USE_DESC_TYPE='Gross Requirements Amt',if(Sum(PERIOD_VAL)>0, 'Yes'), 'No') as listbox

Resident T1

Group By USE_DESC_TYPE;

MVP
MVP

Re: If statement set analysis in Listbox

In text also you must be getting either yes or no, but not both, right? With one data set in scope you can't have both outputs possible. There has to be at least one dimension for that. You can then try like:

=Aggr(if(sum( {<USE_DESC_TYPE={"Gross Requirements Amt"}>}PERIOD_VAL) >0, 'Yes', 'No') , <YourDimension>)

Chanty4u
Esteemed Contributor III

Re: If statement set analysis in Listbox

ok try

=aggr(if(sum({<USE_DESC_TYPE={"Gross Requirements Amt"}>}PERIOD_VAL) >0, 'Yes', 'No'),PERIOD_VAL)

sskiggs1
New Contributor III

Re: If statement set analysis in Listbox

Perfect, Thank you!