Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I wanna calculate the number of saleslines that has different profits
Example:
Calculated dimension (sale profit) Number of orders
less than 0,15 3
0,15-0,29 4
More than 0,29 5
The formula to calculate the sale profit:
sum({<ESTADO_PEDIDO={'Facturado'},CalendarMonthAndYear=, [Codventa]={'PV0***'}>} IMPORTBRUT)
+
sum({<ESTADO_PEDIDO={'Facturado'},CalendarMonthAndYear=, [Codventa]={'PV0***'}>} Cost)
+
sum({<ESTADO_PEDIDO={'Facturado'},CalendarMonthAndYear=, [Codventa]={'PV0***'}>} CAMPAÑA)
To count the number of orders:
Count(DISTINCT{<CalendarMonthAndYear=,ESTADO_PEDIDO={'Facturado'}, [Codventa]={'PV0***'}>} Codventa)
Thank's
Your numbers use a comma as decimal separator: ...nta) < 0,29, dual(... The extra comma mucks up the expressions. You could try using quotes around it "0,29"
Maybe something like this:
if( aggr(sum({<ESTADO_PEDIDO={'Facturado'},CalendarMonthAndYear=, [Codventa]={'PV0***'}>} rangesum(IMPORTBRUT,Cost,CAMPAÑA)),Codventa) < 0.15
, dual('less than 0,15',1),
if( aggr(sum({<ESTADO_PEDIDO={'Facturado'},CalendarMonthAndYear=, [Codventa]={'PV0***'}>} rangesum(IMPORTBRUT,Cost,CAMPAÑA)),Codventa) <= 0.29, dual('0,15-0,29',2),dual('more than 0,29',3)))
Hi Gysbert,
The expression gave me an error and I don't know why?
thank's
=if( aggr(sum({<ESTADO_PEDIDO={'Facturado'},CalendarMonthAndYear=, [Codventa]={'PV0***'}>} rangesum(IMPORTBRUT,Cost,CAMPAÑA)),Codventa) < 0,29, dual('less than 0,29',1),dual('more than 0,29',2))
Your numbers use a comma as decimal separator: ...nta) < 0,29, dual(... The extra comma mucks up the expressions. You could try using quotes around it "0,29"
BRILLIANT!!!!
many thank's!!!