Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
surajap123
Creator II
Creator 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
avinashelite

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

View solution in original post

4 Replies
arvind_patil
Partner - Specialist III
Partner - Specialist III

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

Clever_Anjos
Employee
Employee

Please check if fits your needs

avinashelite

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
Creator II
Creator II
Author

Thanks everyone for various solutions.