1. SAP Help Portal
SAP Analytics Cloud
Analytics Designer Developer Handbook
"Best Practices for Advanced Formulas in Data Actions":
Reference for B & C: The section "Avoid IF Conditions in a FOREACH Loop" states
"An IF condition inside a FOREACH loop is also expensive... A FOREACH loop is also an expensive instruction... If possible
use arithmetical operations on the whole scope." This directly supports reducing both FOREACH and IF statements for better performance.
Reference for D: The section "Avoid RESULTLOOKUP in a FOREACH Loop" states
"The RESULTLOOKUP function is an expensive function... If you use it in a FOREACH loop
the performance of the data action will be very poor." This supports minimizing calls to expensive data functions.
Reference for A (Incorrect): The section "Limit the Scope of a Calculation" emphasizes
"The most important factor for performance is the scope of the calculation... Use the MEMBERSET instruction to limit the members of one or more dimensions." This shows the focus is on specificity
not the quantity of statements.
Reference for E (Incorrect): The recommendation to "use arithmetical operations on the whole scope" instead of FOREACH loops implies that using built-in
optimized functions (including aggregations) is preferable for performance.