Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
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
sunny_talwar

Check out the attached application

View solution in original post

4 Replies
sunny_talwar

Check out the attached application

maxgro
MVP
MVP

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

sunny_talwar

No problem at all

Not applicable
Author

Thanks!!!