Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am doing an if statement for a value field within in pivot table. I have 3 demensions they are PU, RR_constraint and material_no with PU being the top level, then RR_constraint and then material_no. For my expression my if statement is working perfectly when looking at the bottom level of material_no but when i try and look at it from a RR_constraint level it is not rolling up correctly. How can this be fixed. The if statement should be done at a material level and then values added up from there.I have tried aggregating it but not having any luck with it. expression is:
if( Sum({$<OTDM_Type={"Finish_Plan"}>} QTY) = 0 or Sum({<OTDM_Type={"Finish_Actual"}, countable={1}>} QTY) = 0, if( Sum({$<OTDM_Type={"Finish_Plan"}>} QTY) > Sum({$<OTDM_Type={"Finish_Plan"}>} Qty_Finish) + Sum({$<OTDM_Type={"Finish_Actual"}, K_status={"Manually_Created"}>} QTY), Sum({$<OTDM_Type={"Finish_Plan"}>} QTY), Sum({$<OTDM_Type={"Finish_Plan"}>} Qty_Finish) + Sum({$<OTDM_Type={"Finish_Actual"}, K_status={"Manually_Created"}>} QTY) ), if( Sum({$<OTDM_Type={"Finish_Plan"}>} QTY) >= Sum({$<OTDM_Type={"Finish_Plan"}>} Qty_Finish) + Sum({$<OTDM_Type={"Finish_Actual"}, K_status={"Manually_Created"}>} QTY), fabs(Sum({$<OTDM_Type={"Finish_Plan"}>} QTY) - Sum({<OTDM_Type={"Finish_Actual"}, countable={1}>} QTY)), if( Sum({$<OTDM_Type={"Finish_Plan"}>} QTY) < Sum({$<OTDM_Type={"Finish_Plan"}>} Qty_Finish) + Sum({$<OTDM_Type={"Finish_Actual"}, K_status={"Manually_Created"}>} QTY) and Sum({$<OTDM_Type={"Finish_Plan"}>} QTY) > Sum({<OTDM_Type={"Finish_Actual"}, countable={1}>} QTY), (Sum({$<OTDM_Type={"Finish_Plan"}>} QTY) - Sum({<OTDM_Type={"Finish_Actual"}, countable={1}>} QTY)) + FABS((Sum({$<OTDM_Type={"Finish_Plan"}>} QTY) - Sum({$<OTDM_Type={"Finish_Plan"}>} Qty_Finish) + Sum({$<OTDM_Type={"Finish_Actual"}, K_status={"Manually_Created"}>} QTY))), FAbs( Sum({$<OTDM_Type={"Finish_Plan"}>} QTY) - Sum({$<OTDM_Type={"Finish_Plan"}>} Qty_Finish) + Sum({$<OTDM_Type={"Finish_Actual"}, K_status={"Manually_Created"}>} QTY) ) ) ) )
I think maybe you need to simplify your expression for this example so that it is more readable, and you should probably include some more information in your question - perhaps some images of what it looks like and more explanation of what is wrong in that image and how you want it to be. Perhaps even example of some raw/straight data that is feeding the pivot table. It is very difficult to try to help you based on the information you have given so far.