Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

robert2012
New Contributor III

Calculation-Problem in diagram

Hi all,

I want to calculate a field in a diagram:

(sum(Price1)+sum(price2)) / sum(cost)

It doesn't work right: Do u have any idea how to get multiplication and division first, then addition and subtraction?

THX

1 Solution

Accepted Solutions
MVP
MVP

Re: Calculation-Problem in diagram

Do you mean this:

=Sum((Price1 + Price2)/Cost)

Although I would do this rather - it will handle nulls properly:

=Sum(RangeSum(Price1, Price2)/Cost)

2 Replies

Re: Calculation-Problem in diagram

What you provide the expression will work. And it works and starts from Left - Right. Ref image attacched

Order_of_Prec.gif

MVP
MVP

Re: Calculation-Problem in diagram

Do you mean this:

=Sum((Price1 + Price2)/Cost)

Although I would do this rather - it will handle nulls properly:

=Sum(RangeSum(Price1, Price2)/Cost)