Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Only display values greater than 2 in list box

Hey guys,

New to Qlikview.

Is it possible to only display values on a list box depending on how many times I have it on my excel file?

I have this excel file that has a client ID twice, and i want to display that on my list box and hide whatever is less than 2.

Thanks in advance.

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi

Agrree to Satyadev.

Just make 1 instead of 2 in if condition.

=if(aggr(count(fieldname),fieldname>1,fieldname)

View solution in original post

11 Replies
johnca
Specialist
Specialist

Hi Leonardo,

Try by crating a list box and using expression rather than the field itself (look at the very bottom of the field list for expression), write it like this...

If(Count(<field> >2, <field>)

where <field> is the field you want to display.

--john

Anonymous
Not applicable
Author

Hi,

Try below in list box

=If(Aggr(Count(fieldname), fieldname)>2, fieldname)

Thanks

Not applicable
Author

Hi guys, thanks for the quick responses.

If I use any of those formulas I don't get anything displayed.

Anonymous
Not applicable
Author

Look into attached file

Not applicable
Author

Thanks Satyadev, but I can't open the file, I am running the personal edition of Qlikview.

Anonymous
Not applicable
Author

Hi

Agrree to Satyadev.

Just make 1 instead of 2 in if condition.

=if(aggr(count(fieldname),fieldname>1,fieldname)

Anonymous
Not applicable
Author

Ok. So what actually I am doing in attached file is, I have created one inline table (see below) which has some duplicates record,

Temp:

LOAD * INLINE [

    empname

    abc

    abc

    abc

    xyz

    xyz

    xyz

    efg

    efg

    uvw

];

And after reload, I used below script in list box's expression to sort out your issue.

=If(Aggr(Count(empname), empname)>2, empname).

PS: You have to click on <Expression> from field drop down in list box object (see below) and copy the above expression.listbox.PNG.png

Hope this helps you

Satya

Not applicable
Author

Thank you guys!!!!

That worked like a charm!

All sorted out!

johnca
Specialist
Specialist

Just curious...why use 'aggr' when it is not necessary? When you are dealing with just one field all it does is create unnecessary extra overhead.


--john