Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
In a pie chart I need to separate the average monthly sales as follows:
> 1000
> 500 and <= 1000
> 0 and <= 500
As shown in the image in the attachment qvw
Regards.
you can use a calculated dimension.
=if((Cant >0 and Cant <= 500),'0-500',
if((Cant > 500 and Cant <=1000),'501-1000','>1000'))
Class() may work as well.
With the data you provided, the pie would not calculate because of negative numbers.
I used a set expression to overcome that issue.
sum( { $<Cant= {">0"} >} Cant )
Wade
serviambi.com
I put something together quickly that uses a calculated dimension to generate the thresholds used in the pie chart. Please see the attached document.
Dear Sandro,
Please check and let me know .
Thanks
Hi.
Your answer works perfect, but I need to separate the monthly average.
Example:
If(Sum(Cant)/3<=500,'0-500',If(Sum(Cant)/3<=1000,'500-1000',If(Sum(Cant)/3>=1000,'>1000')))
and this fails.
Regards.
Sorry ,
Please check the attachment of qvw.
Hi shaik
Your example is empty.
Regards.
It may make sense to build this dimension in the script using the group by function. I think the issue you're seeing is that when you try to use Sum(Cant) in the calculated dimension, it doesn't know what group of records needs to be summed. Try something like what I did in the script of the attached doc. One thing to note, is that I'm not sure what field you're trying to sum for, so you may need to change the producto fields in the attached script. At the very least this should give you a starting point to work from.