Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all, hope you can help me with this little issue.
Here is a table where COST column is the result of FACT_DPT/FACT_TOT * TOT_COST:
(SUM({1<ANYOlinfact={$(=vActualYear)}, PROFIT ={"Eat"}, TYPE ={"COST"}, Cost = {">0"}>} factlin* Price))
/
(SUM({1<ANYOlinfact={$(=vActualYear)}, TYPE ={"COST"}, PROFIT -={"Dora"}, Cost = {">0"}>} factlin* Price) - (Sum({1<TYPE ={ 'COM'}, CodCli = {2447}>} Cost)))
* Max({<TYPE ={"COST"} >} Cost)
Problem arise when I insert above formula into Pivot Table containing Customer & Month.
((Sum(aggr(SUM(total{1<ANYOlinfact={$(=vActualYear)}, PROFIT ={"Eat"}, TYPE ={"COST"}, Cost = {">0"}>} total <MONTH > factlin* Price), MONTH, CUSTOMER )))
/
Sum(aggr(SUM(total{1<ANYOlinfact={$(=vActualYear)}, TYPE ={"COST"}, PROFIT -={"Dora"}, Cost = {">0"}>} total <MONTH > factlin* Price)- Sum(total{1<TYPE ={ 'COM'}>} Cost),MONTH, CUSTOMER))
* aggr(sum(total{1<TYPE ={"COST"} >} Cost), MONTH, CUSTOMER ))
Many TKS in advance.
Try it in this way:
Sum(aggr(
(SUM({1<ANYOlinfact={$(=vActualYear)}, PROFIT ={"Eat"}, TYPE ={"COST"}, Cost = {">0"}>} factlin* Price))
/
(SUM({1<ANYOlinfact={$(=vActualYear)}, TYPE ={"COST"}, PROFIT -={"Dora"}, Cost = {">0"}>} factlin* Price) - (Sum({1<TYPE ={ 'COM'}, CodCli = {2447}>} Cost))) * Max({<TYPE ={"COST"} >} Cost),
MONTH, CUSTOMER ))
- Marcus
Try it in this way:
Sum(aggr(
(SUM({1<ANYOlinfact={$(=vActualYear)}, PROFIT ={"Eat"}, TYPE ={"COST"}, Cost = {">0"}>} factlin* Price))
/
(SUM({1<ANYOlinfact={$(=vActualYear)}, TYPE ={"COST"}, PROFIT -={"Dora"}, Cost = {">0"}>} factlin* Price) - (Sum({1<TYPE ={ 'COM'}, CodCli = {2447}>} Cost))) * Max({<TYPE ={"COST"} >} Cost),
MONTH, CUSTOMER ))
- Marcus
Perfect Marcus!!. Many Thanks!!.