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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
rcandeo
Creator III
Creator III

Doubt with and aggregate expression

I have this expression above that works in all lines, but in the line total, if there is any line with zero value, it returns an invalid value (-).

(sum(distinct aggr(avg(amount),document,Customer,company))+sum(amount_tax))*Tax /100

I´ve made a comparison testing if tax is zero, but it didn't work anyway.

if(Tax<>0,((sum(distinct aggr(avg(amount),document,Customer,company))+sum(amount_tax))*Tax /100),0)

Anyone can give a hint to solve my problem?

For information:

I have in my table the amount for document and I need to find out the tax value. I am using an aggregate expression cause I have the amount of the document in all lines (a document can have n lines), and if I don't do this aggregate, It'll multiply the tax value by the lines of the document.

0 Replies