Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Announcing the newest addition to the Qlik Community, Qlik Gallery! Learn More
Highlighted
Not applicable

Button Action on the SUM of Multiple Fields (Equal and Not Equal to 0)

Can anyone tell me the best way to transform this SQL Statement into an action in a Button?

SELECT *

WHERE ((GROSS_1+GROSS_2)<>0)

Basically, I want the button to select all values where the sum of GROSS1 OR GROSS2 are NOT Equal to Zero..

Example:

LINE# GROSS1      GROSS2

    1          0                   400

    2          400               800

    3          0                   0

So, LINES 1 & 2 should be returned at the click of the button.

The negation of that would be helpful too. (Values where GROSS1 AND GROSS2 = 0)

1 Solution

Accepted Solutions

Re: Button Action on the SUM of Multiple Fields (Equal and Not Equal to 0)

Check out the attached application

4 Replies

Re: Button Action on the SUM of Multiple Fields (Equal and Not Equal to 0)

Check out the attached application

MVP
MVP

Re: Button Action on the SUM of Multiple Fields (Equal and Not Equal to 0)

maybe you can add a flag (thanks Sunny, I used your .qvw)

Table:

LOAD * Inline [

LINE#, GROSS1, GROSS2

    1, 0,      400

    2, 400,    800

    3, 0,      0

    4,,

];

Left Join (Table)

LOAD LINE#,

if(sum(GROSS1) + sum(GROSS2)>0,1,0) as Flag

Resident Table

group by  LINE#;

and in the action of the buttons

1.png

Re: Button Action on the SUM of Multiple Fields (Equal and Not Equal to 0)

No problem at all

Not applicable

Re: Button Action on the SUM of Multiple Fields (Equal and Not Equal to 0)

Thanks!!!