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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
rcandeo
Creator III
Creator III

Help me with this aggregation

I have this expression below 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