Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
antonrus
Contributor III
Contributor III

select on condition

Hello (sorry do not speak in English)

there is a table

Checknum

Price without discount

Sum of Discounted

discount Amount

122444

10

8

2

122445

15

15

0

It is necessary to select only those checks which have discount and skip the checks that have no discount. And to calculate the amount of revenue these checks.

(If it was possible, I would like to calculate the price and dishes that were in the checks which had a discount but for which the discount is not applied, but it is probably very difficult ..)

Thank you very much for your help!

Labels (1)
6 Replies
anbu1984
Master III
Master III

Use where condition (where discount_Amount > 0)

antonrus
Contributor III
Contributor III
Author

and how to write it? I do not understand ..

anbu1984
Master III
Master III

LOAD *

SQL SELECT Checknum,Price_without_discount,Sum_of_Discounted, discount_Amount

FROM SCHEMA.TABLE_NAME

WHERE discount_Amount > 0;

antonrus
Contributor III
Contributor III
Author

thanks for the report , but I did not change the sql query mou . Rather - myeon table which is - it's not a table , I received a table calculations qlikview.

for example, discount_Amount= Price_without_discount- discount_Amount

antonrus
Contributor III
Contributor III
Author

trying to write it something like this:

if ({(sum(sum (PAYSUM))-(sum (PRLISTSUM))={">0"}>})), CHECKNUM

but does not work

anbu1984
Master III
Master III

Try this expression for your dimension

If(Aggr(Sum([Price without discount]-[Sum of Discounted]),Checknum) > 0,Checknum)