Nested IFs or use Contine. What gives better performance?
Posted: Thu Apr 28, 2016 2:25 pm
Hi all,
Im rebuilding some stuff at work and need some advice on what is best from a performance perspective. This cube is going to get big because of an "advanced" idea on how things should be organized.
Consider the two examples:
Example 1:
Example 2:
Currently the new rebuilt model is small and I can't notice any difference in performance. I do however have other similar parts of the solution that is built more like Example 2. Im not that experienced but I find those parts of the model to have surprisingly fast performance considering the size. That is compared to other stuff I made like Example 1. But i could be imagining things, and there are other factors that affect performance.
So does anyone know if Example 1 or Example 2 is better from a performance perspective? Someone thats been doing this a lot longer than I have? I looked around for a best practice but found none.
Regards
David
Im rebuilding some stuff at work and need some advice on what is best from a performance perspective. This cube is going to get big because of an "advanced" idea on how things should be organized.
Consider the two examples:
Example 1:
Code: Select all
['Value'] = N:
IF( !Period <= ['PeriodBreak1'],
['Value1'],
IF( !Period <= ['PeriodBreak2'],
['Value2'],
IF( !Period <= ['PeriodBreak3'],
['Value3'], ['Value4']
)
)
) ;
Example 2:
Code: Select all
['Value'] = N:
IF( !Period <= ['PeriodBreak1'],
['Value1'],
CONTINUE
) ;
['Value'] = N:
IF( !Period <= ['PeriodBreak2'],
['Value2'],
CONTINUE
) ;
['Value'] = N:
IF( !Period <= ['PeriodBreak3'],
['Value3'],
['Value4']
) ;
So does anyone know if Example 1 or Example 2 is better from a performance perspective? Someone thats been doing this a lot longer than I have? I looked around for a best practice but found none.
Regards
David