Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Trying to sum a very specific group of data

Hi,

          Here is the issue, i already have a box with data that is selected with a calculated dimension:

=if(aggr(sum(Sales),Description)>Average_Sales

AND aggr(Sum(Margin),Description)/aggr(sum(Sales),Description) > %Margin

,Description)

With this sentence im able to select those products that are above the average sales and those who margin more. and till that point, all is good.

now, i want to know the sum of sales of all those products which im trying with

=sum(if(aggr(sum(Sales),Description)>Factor_Prom_VNF

AND aggr(Sum(Margin),Description)/aggr(sum(Sales),Description) > %Margin,Sales))

But this way I only get the first (or last) value of the list of products (Description = product name)

hope someone can help me.

thx in advance

10 Replies
Not applicable
Author

Your seond expression is different than the first one. Can you please explain what are you trying to accomplish with the second statement? I could not understand your point.

Thanks

Not applicable
Author

Hi

  I put the first one in a calculated dimension of a simple table, so i know wich products join into the first group, then i add a simple sum(sales) into the expressions so then i know the sales of those products.

now i been asked to know the sales participation of those productos, i need the to know the sum value of them.

thx

Not applicable
Author

Any thoughts? please

Not applicable
Author

If u're using as dimension then,

aggr(sum(if(aggr(sum(Sales),Description)>Factor_Prom_VNF

AND aggr(Sum(Margin),Description)/aggr(sum(Sales),Description) > %Margin,Sales)), Product)

Not applicable
Author

In looking to put the result as a Text box.

calvindk
Creator III
Creator III

Could you upload a sample qvw?

Not applicable
Author

Im adding an example.

Thx.

Not applicable
Author

can't open ur qvw at the moment.

try and put sum around the expression above:

sum(aggr(sum(if(aggr(sum(Sales),Description)>Factor_Prom_VNF

AND aggr(Sum(Margin),Description)/aggr(sum(Sales),Description) > %Margin,Sales)), Product))

Not applicable
Author

Hi,

It keeps showing me the top of the group, not the sum of all the elements.

Thx