Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
katragadda
Contributor II
Contributor II

sum of the sales

Hi Friends,

i have a table like following.

customer

productsalesHeader 3
aapple100
bmango50
capple,mango200

Now my requirement is i want find the sum of sales  for the product is mango.

Thanks..

6 Replies
sunny_talwar

Are you expecting 50 for sales of mango or 250 (200+50)? or some other number?

sunny_talwar

If you want 50... try this

Sum({<product = {'mango'}>} sales)

If you want 250, then try this

Sum({<product = {"*mango*"}>} sales)

PabloTrevisan
Partner - Creator II
Partner - Creator II

You need a table with the price of each product...
I know that the apple costs 100 and mango 50, so you make a count..


to count the claims and multiply by the value of the unit product


It helps?

PabloTrevisan
Partner - Creator II
Partner - Creator II

Prints.

Create a flag to discount apple.
Screenshot_1.jpg

SETANALYSIS :

sum({<flag = {1} >}  salesHeader3)

-

sum({<product = {'apple'}>} price)

Screenshot_2.jpg

Colin-Albert

What has been sold to customer C?

200 apples & 200 mangoes

100 apples and 100 mangoes

200 apples & 0 mangoes

0 apples & 200 mangoes

50 apples & 150 mangoes

or some other combination.  Your data does not make this clear.

If customer C has purchased two products, then your data should have 2 lines for customer C listing each product and quantity sold on separate lines.

Is the table you have listed the actual source data?

nishanthi_8
Creator
Creator

To be dynamic, you can go for Sum({<Product={'$(=Product)'}>}SalesHeader3). So if any product is selected it will give the sum of sales as per that product