Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
mellerbeck
Contributor II

Help with Margin % expression, problem with division by zero?

I have two rows of data, Customer, Product, Cost & inputfields of New Price and New Volume

The Bid Sales is calculated by New Price * New Volume

The Bid Cost is Cost/LB * New Volume

The Margin $ Is Bid Sales - Bid Cost

And the Margin % is Margin $ / Bid Sales

This appears to work but when I put in values for the first product for the first New Price and New Volume the total for the Margin % shows 10% when I would expect it to be 50%, matching the single row of data's margin.

margin.PNG

Tags (1)
4 Replies
Not applicable

Re: Help with Margin % expression, problem with division by zero?

Hi mellerbeck,

Please, change your "Bid Cost" Expression:

sum(CurrentCostPerLB * NewVolume)

Let me know, if this change was helpful for you

Regards,

Ricardo

mellerbeck
Contributor II

Re: Help with Margin % expression, problem with division by zero?

I tried similar things to that, but that isn't quite it. I have to use sum(CurrentCostPerLB * Column(3)) but that still doesn't do the trick?

Not applicable

Re: Help with Margin % expression, problem with division by zero?

Check my release. It works.

mellerbeck
Contributor II

Re: Help with Margin % expression, problem with division by zero?

Ahh! I see now, thank you! I was trying to use the [New Volume] calculated for the column, instead of going straight to the data that is in the NewVolume...  at least that is how I see it! Anyways, yes it works!

Community Browser