Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to create a filter

Greetings,

I am using Qlikview 10 personal edition.

I would like to ask you how to create a filter in Qlikview.

Actually I have created tow straight boxes there I have included wo labels one is "Matching_status' which is showing whether the record is "matched" or "unmatched" and another one is "service_status" which is showing whether it is "included" or "excluded".

When I am creating a listbox and in general tab, in the field section when I am giving the expression as " if(x=y, 'Included', 'Excluded').. it is showing me two fields as Included, Excluded in the listbox.. But default is taking the first one and the second one is not functioning at all..

Hope you are all getting my point.

Please explain how to resolve it.

1 Solution

Accepted Solutions
Not applicable
Author

Do you mean something like this

View solution in original post

23 Replies
Not applicable
Author

I mean to say it is only taking the True value not the false value. why don't understand.

Not applicable
Author

It is not completely clear whay you mean, can you post your report as an example?

Regards,

Bert

Not applicable
Author

The report scenario is : There are straight tables one is Account another is contact..

My task is comparing data from two datasources x and y.

in Account straightable I have x.x1,y.x1, x.x2,y.x2 and so on...  Same here in Contact table.. I have added one label as "Matching Status"..

There I am comparing these data..

But I have to filter these data so that they can see only matching or unmatching data.. So I have created one listbox.. But it is showing only the true value means only the matching data not the unmatching data..

Hope this explanation will help you to understand my query.

Many Thanks

Sandeepa

Not applicable
Author

Hi Sandeepa,

Can you post a snippet of your script where you determine the matching / unmatching part?

Regards,

Bert

Not applicable
Author

For contacts:

if(med_title=aspen_title and med_persontypename=aspen_persontypename and med_initials=aspen_initials and med_firstname=aspen_firstname and med_lastname=aspen_lastname and med_recordstatus=aspen_recordstatus and aspen_gender=med_gender and aspen_person_service=med_person_service, 'matched','unmatched')

For Accounts:

if(med_orgname=aspen_orgname and med_orgstatusname=aspen_orgstatusname and med_orgtypename=aspen_orgtypename and postal_street=med_postalstreet and shipping_street=med_shippingstreet ,'matched','unmatched')

In listbox I am combining both.

Not applicable
Author

if((med_orgname=aspen_orgname and med_orgstatusname=aspen_orgstatusname and med_orgtypename=aspen_orgtypename and postal_street=med_postalstreet

and shipping_street=med_shippingstreet) and (med_title=aspen_title and med_persontypename=aspen_persontypename and med_initials=aspen_initials

and med_firstname=aspen_firstname and med_lastname=aspen_lastname and med_recordstatus=aspen_recordstatus and aspen_gender=med_gender

and aspen_person_service=med_person_service),'matched','unmatched')

if(aspen_person_service=med_person_service, 'Included', 'Excluded')

This is the list box query

I don't understand why it is showing only the True values..

I am writing the expression in Generaltab->field->expression.

Not applicable
Author

Hi Sandeepa,

The logic in the listbox should be moved to the script. The resulting column should be shown in the listbox.

Regards,

Bert

Not applicable
Author

Please explain in brief..

Not applicable
Author

Hi,

You need to make sure that the unmatched definition is linked to the unmatched data.

Something like this has to be created:

Tables created earlier in script:

Table A

     TableA.ID

     ....

     TableA.Matched

Table B

     TableB.ID

     TableA.ID

     ....

     TableB.Matched    

New script part:

MatchLink:

LOAD TableA.ID,

          TableA.Matched

resident TableA;

left join (MatchLink)

LOAD TableA.ID,

          TableB.ID,

          TableB.Matched

resident TableB;

join (MatchLink)

      TableA.ID,

      TableB.ID,

      if(TableA.Matched='Matched' and TableB.Matched='Matched', 'Matched', ' Not matched') as Matched

resident MatchLink;

drop field TableA.Matched, TableB.Matched from MatchLink;

regards,

Bert