Forum Discussion
Anonymous
6 years agoNot applicable
Performance Issue Advice
Hi guys! I am suffering with a performance issue for a measure. It is derived from several others, so I'll paste all the ones that are calculated for the last one to exist. All the previous are...
- Anonymous6 years ago
Anonymous,
You can use variable to avoid double calculation in your measure:
Excess Stock = VAR result = [Valid Stock Value] - [TargetStockValue] - [No Future Use] RETURN IF ( result < 0, 0, result ) - Anonymous6 years ago
Anonymous,
Same principle applies. You want to avoid repeating measure because it calculates every time you mention it. Use variable so the result is stored in the memory
Stock OK = VAR validStock = [Valid Stock Value] VAR targetStock = [TargetStockValue] RETURN SWITCH ( TRUE (); validStock >= targetStock; targetStock; validStock )
Anonymous
6 years agoNot applicable
Anonymous,
You can use variable to avoid double calculation in your measure:
Excess Stock =
VAR result = [Valid Stock Value] - [TargetStockValue] - [No Future Use]
RETURN
IF ( result < 0, 0, result )Anonymous
6 years agoNot applicable
Anonymous
This one is still a bit slow, though... any ideas about it?
Stock OK = SWITCH(TRUE();
[Valid Stock Value]>=[TargetStockValue];[TargetStockValue];
[Valid Stock Value])
- Anonymous6 years agoNot applicable
Anonymous,
Same principle applies. You want to avoid repeating measure because it calculates every time you mention it. Use variable so the result is stored in the memory
Stock OK = VAR validStock = [Valid Stock Value] VAR targetStock = [TargetStockValue] RETURN SWITCH ( TRUE (); validStock >= targetStock; targetStock; validStock )