Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Not applicable

Filter

Hello,

I'm having a pivot table with expression which has negative, 0 and positive values. I want to give a button and on click of that button I want to have my users see only the rows with this expression having 0 values. How would I do that?

Tags (1)
1 Solution

Accepted Solutions
MVP
MVP

Re: Filter

Consider you have below data

Load * Inline

[

  Item, PurchaseCost, SalesCost

  A, 100, 100

  B, 120, 150

  C, 90, 135

  D, 1200, 1100

  E, 1000, 1100

  F, 500, 500

  G, 200, 200

];

and after clicking the button, you want to show only Items A,F,G where TotalPurchaseCost and TotalSalesCost are same.. You can use as below

Create a button

Add Action

Select in Field

Field

Item

Search String

='=SUM(PurchaseCost)-SUM(SalesCost)=0'

6 Replies
MVP
MVP

Re: Filter

Consider you have below data

Load * Inline

[

  Item, PurchaseCost, SalesCost

  A, 100, 100

  B, 120, 150

  C, 90, 135

  D, 1200, 1100

  E, 1000, 1100

  F, 500, 500

  G, 200, 200

];

and after clicking the button, you want to show only Items A,F,G where TotalPurchaseCost and TotalSalesCost are same.. You can use as below

Create a button

Add Action

Select in Field

Field

Item

Search String

='=SUM(PurchaseCost)-SUM(SalesCost)=0'

Not applicable

Re: Filter

Thanks Manish!! It works. I want to use the same button to toggle between 0 and Non zero values, is this possible?

alkesh_sharma
Contributor III

Re: Filter

Put the same expression

For Negative Values:

=SUM(PurchaseCost)-SUM(SalesCost)<0'


For Positive Values

=SUM(PurchaseCost)-SUM(SalesCost)>0'

Not applicable

Re: Filter

How would first click of a button be positive and second click of a button be negative? I want to use only one button but different action.

alkesh_sharma
Contributor III

Re: Filter

Create Two Buttons, Place them exactly over one another. and conditional hide and show them accordingly.

Highlighted
alkesh_sharma
Contributor III

Re: Filter

Please find the file attached for your reference.