Skip to main content
Announcements
Qlik Community Office Hours, March 20th. Former Talend Community users, ask your questions live. SIGN UP
cancel
Showing results for 
Search instead for 
Did you mean: 
jagannalla
Partner - Specialist III
Partner - Specialist III

Filter all fields in table based on input variables

Hi,

Before going to my content can you please see my qvw file...

In my qvw file i had 3 fields A,B,C. I want to filter each field base on input variables.

For Eg:

To filter A, i'm taking vMinA=3 & vMaxA=11 variables in input box.

Now, in table i want to see A field with values between this range 3 to 10 only...

Like this i want to apply for all other fields also at a time.

1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

HI,

    Its not possible to filter data in the table box, the reason is table box is used to just display the raw data.

    So you can use the seperate listbox to filter the data.

    For filtering field A, try below.

    Right click on the sheet -> New Sheet Object -> List box -> In field Drop down select Expression.

    and type below expression.

    =if(A >= $(vMinA) and A<=$(vMaxA),A)

    Try same for the rest of the fields.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

21 Replies
swuehl
MVP
MVP

Mr Nokia,

you can do this in a straight table with a hidden expression like in my example.

Hope this helps,

Stefan

jagannalla
Partner - Specialist III
Partner - Specialist III
Author

Hi,

If one of the variable are empty it is not display any data in straight table. And also i'm not getting exact result in table.

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

HI,

   Have a look at the attched file.

   Hope this is what you want.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable

Hi Nokia,

You can see the attached example.

Best regards.

jagannalla
Partner - Specialist III
Partner - Specialist III
Author

kaushik/iuliancc,

Sorry i'm not able to open your file. B'coz i'm using personal edition.

Can you please say the steps

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

HI,

    Its not possible to filter data in the table box, the reason is table box is used to just display the raw data.

    So you can use the seperate listbox to filter the data.

    For filtering field A, try below.

    Right click on the sheet -> New Sheet Object -> List box -> In field Drop down select Expression.

    and type below expression.

    =if(A >= $(vMinA) and A<=$(vMaxA),A)

    Try same for the rest of the fields.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable

Hi,

Put this script in your "DataSet.qvw" example and reload data

TAB1:

LOAD * INLINE [

    A,   B, C

    1,  66, 5

    2,  33, 100

    4,  77, 56

    10, 29, 90

    3,  49, 10

    20, 35, 20

    11, 99, 40

    13, 31, 50

];

 

TAB2:

LOAD

     num(A) as Aa

RESIDENT TAB1   

WHERE A > '$(vMinA)' and A < '$(vMaxA)'

     

     

;

CONCATENATE

LOAD

    num(B) as Bb

   

RESIDENT TAB1

WHERE B > '$(vMinB)' and B < '$(vMaxB)'

;

CONCATENATE

LOAD

    num(C) as Cc

   

RESIDENT TAB1

WHERE C > '$(vMinC)' and C < '$(vMaxC)'

;

Maybe the result is what you want.

Regards.

jagannalla
Partner - Specialist III
Partner - Specialist III
Author

But i want to filter all fields in single object.

I tried like this i had taken straight table then i add a dimension as ID, and expressions as 

1.sum({<A={">=$(vMinA)<=$(vMaxA)"}>} A)

2.sum({<B={">=$(vMinB)<=$(vMaxB)"}>} B)

3.sum({<C={">=$(vMinC)<=$(vMaxC)"}>} C)

- Now it is working good for me. But i'm  creating qvd for this straight table in button action with macro.

- When i didn't load B then i'm getting 0's in B expression. But i don't want to see this column in created qvd file when it is not loaded.

load

  Rowno() as ID,

  A,

// B,

  C

from table.qvd;

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

   In presentation tab of the straight table peoperty, you can hide a column when there is some condition.

   Try to put condition there to hide that column.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!