Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

surajap123
Contributor II

filter

Hi All,

I want to create a field or a front end expression to filter rows in Status field.

The user should have 2 values to choose- Top, All.

When All is selected, show all products. If Top is selected show only products with status Yes.

Data:

LOAD * INLINE [

    Product, Status

    A, YES

    A, YES

    B, YES

    C, NO

    D, NO

];

I created this filter but it is not working

if(Status = 'YES' or Status = 'NO','All',

if(Status = 'YES','Top'))


Please help.

1 Solution

Accepted Solutions

Re: filter

Try like this

Data:

LOAD * INLINE [

    Product, Status

    A, YES

    A, YES

    B, YES

    C, NO

    D, NO

];

LOAD * INLINE

[

Status,Filter

YES,TOP

YES,ALL

NO,ALL

];


Now use the filter column in the front end to get the desired results

4 Replies
arvind_patil
Valued Contributor II

Re: filter

Hi Suraj,

You need to create only top filter why you require all

If top is not selected means its by default all.

If(Status = 'YES','Top') as TOP.


Thanks,

Arvind patil

Employee
Employee

Re: filter

Please check if fits your needs

Re: filter

Try like this

Data:

LOAD * INLINE [

    Product, Status

    A, YES

    A, YES

    B, YES

    C, NO

    D, NO

];

LOAD * INLINE

[

Status,Filter

YES,TOP

YES,ALL

NO,ALL

];


Now use the filter column in the front end to get the desired results

surajap123
Contributor II

Re: filter

Thanks everyone for various solutions.