 Report Design Crystal Reports Forum : Crystal Reports 9 through 2016 : Report Design  Topic: Multiplying Array by formula  Oldest Post First Newest Post First
 Author Message CR_Steve Newbie  Joined: 13 Feb 2019 Location: United States Online Status: Offline Posts: 3 Topic: Multiplying Array by formula    Posted: 08 Mar 2019 at 6:49am I have the following formula if {@1st_sort} = "LABOR" then      [{CfgCalc.AICCost1}, {CfgCalc.AICCost2}, {CfgCalc.AICCost3}, {CfgCalc.AICCost4}, {CfgCalc.AICCost5}] [{@QtyIndex}]*{@LaborMU})this formula is is in Group Header #3 and is summarized in GF#3. But as you can imagine it is coming in blank. Is there a way to display the @LaborMU as a number so that the CfgCalc.AICcost will multiply. Thanks for any help IP Logged hilfy Admin Group  Joined: 20 Nov 2006 Online Status: Offline Posts: 3663 Posted: 11 Mar 2019 at 7:17am What does the @LaborMU formula look like? If it returns an array, what type of data is in the array? If the array contains numbers, how would you want to handle it in this situation - concatenate the numbers, sum the numbers, multiply the numbers? -Dell Proviti, Data & Analytics Practice 9-Time SAP BusinessObjects Partner of the Year. www.protiviti.com/US-en/data-management-advanced-analytics IP Logged CR_Steve Newbie  Joined: 13 Feb 2019 Location: United States Online Status: Offline Posts: 3 Posted: 14 Mar 2019 at 5:24am This is Th @LaborMU formula 1+({@PrtLaborOAMkup}/100)And this is the @PrtLaborOAMkup formulaformula = {@LaborOAMarkup}*100And this is the @LaborOAMarkup formula [ {OverallMarkups.LaborQ1}, {OverallMarkups.LaborQ2}, {OverallMarkups.LaborQ3}, {OverallMarkups.LaborQ4}, {OverallMarkups.LaborQ5} ] [{@QtyIndex}] IP Logged hilfy Admin Group  Joined: 20 Nov 2006 Online Status: Offline Posts: 3663 Posted: 20 Mar 2019 at 9:37am I think I know what the problem is. You can't display something in a group header that doesn't have data until after all of the group data is processed. However, there is a way around this if there will only be one value for the result at the end of the group. Try this: ```WhilePrintingRecords; if {@1st_sort} = "LABOR" then MAXIMUM(     [{CfgCalc.AICCost1}, {CfgCalc.AICCost2},      {CfgCalc.AICCost3}, {CfgCalc.AICCost4},      {CfgCalc.AICCost5}] [{@QtyIndex}]*{@LaborMU})``` -Dell Proviti, Data & Analytics Practice 9-Time SAP BusinessObjects Partner of the Year. www.protiviti.com/US-en/data-management-advanced-analytics IP Logged CR_Steve Newbie  Joined: 13 Feb 2019 Location: United States Online Status: Offline Posts: 3 Posted: 22 Mar 2019 at 7:37am This is the entire formula if {@1st_sort} = "OUTSD" or {@1st_sort} = "DELVRY" then [{CfgCalc.Cost1}, {CfgCalc.Cost2}, {CfgCalc.Cost3}, {CfgCalc.Cost4}, {CfgCalc.Cost5}] [{@QtyIndex}] * 1.15 else if {@1st_sort} = "LABOR" then      [{CfgCalc.AICCost1}, {CfgCalc.AICCost2}, {CfgCalc.AICCost3}, {CfgCalc.AICCost4}, {CfgCalc.AICCost5}] [{@QtyIndex}]*{@LaborMU} else if {@1st_sort} = "MATRL"   then    (  if {@2nd_sort} = "001" then        [{CfgInkCalc.Cost1}, {CfgInkCalc.Cost2}, {CfgInkCalc.Cost3}, {CfgInkCalc.Cost4}, {CfgInkCalc.Cost5}] [{@QtyIndex}] * 1.1       else if {@2nd_sort} = "000" then        [{CfgStockCalc.Cost1}, {CfgStockCalc.Cost2}, {CfgStockCalc.Cost3}, {CfgStockCalc.Cost4}, {CfgStockCalc.Cost5}] [{@QtyIndex}] * 1.12       else         [{CfgCalc.Cost1}, {CfgCalc.Cost2}, {CfgCalc.Cost3}, {CfgCalc.Cost4}, {CfgCalc.Cost5}] [{@QtyIndex}] * 1.1       )else 0This is in Group header #3 and it is suppressed. This is then summed in Group Footer# 3But the red text is coming in blank. 2nd sort calculates fine. You can see that it is multiplied by a number. Whereas 1st sort need to be multiplied by a formula because the value will change. @LaborMU is a user input number IP Logged   Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum

This page was generated in 0.016 seconds.