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: 
alexsid-qlik
Contributor II
Contributor II

Set Analysis Pricing

Dear Community,

I am struggling with my calculation. What I have is a list of Options and their respective price. Also I know how many of them were sold. So I want to cumulate this Sales.

I tried this approach : Sum({$<[Price] -= '0'>} [Price]*Quantity)

But it doesn't work properly! I attached an excel as an example.

I would be happy for your help.

Regards, Alex

1 Solution

Accepted Solutions
sunny_talwar

Try this

Sum({$<[Price] -= {'0'}>} [Price]*Quantity)

View solution in original post

9 Replies
sunny_talwar

Try this

Sum({$<[Price] -= {'0'}>} [Price]*Quantity)
Anil_Babu_Samineni

Try this as well, Make sure whether you have applied correct field

Sum(If(Price <> '0', Price*Quantity))

Or

Sum({<Price = {"=Sum(Price)<>0"}>} Price*Quantity)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
alexsid-qlik
Contributor II
Contributor II
Author

Thank you @sunny_talwar and @Anil_Babu_Samineni!

Both solutions work excellent for me.

alexsid-qlik
Contributor II
Contributor II
Author

Hi,

the number seemed a little bit too high actually.

So I exported my table to Excel. And when I sum up there I get a much lower number. How can that be? 

Would be thankful for help.

sunny_talwar

Would you be able to share a sample to show the issue?
alexsid-qlik
Contributor II
Contributor II
Author

I cant share my initial data because it is sensitive. And when I simplify the data it works. So there must me something wrong in my data. I am sure the formula works right.
sunny_talwar


@alexsid-qlik wrote:
I cant share my initial data because it is sensitive. And when I simplify the data it works. So there must me something wrong in my data. I am sure the formula works right.

In that case, I am not really sure how to help you... I mean I need to see something before I can see what might be going on.

alexsid-qlik
Contributor II
Contributor II
Author

ok i found my mistake. I had a wrong Where statement in my load script.
sunny_talwar

Great 🙂