Forum Discussion
VAR doesn't work
- Anonymous9 years ago
The expressions will have to be written as follows
VAR LVL1 =
COUNTAX ( FILTER ( LIMLOGN, LIMLOGN[LvlCode] = 1 ) ,LIMLOGN[LvlCode] )
VAR LVL2 =
COUNTAX ( FILTER ( LIMLOGN,LIMLOGN[LvlCode] = 2 ), LIMLOGN[LvlCode] )
VAR LVL3 =
COUNTAX ( FILTER ( LIMLOGN, LIMLOGN[LvlCode] = 3 ) ,LIMLOGN[LvlCode] )
VAR LVLTOT =
COUNTAX ( ALL ( LIMLOGN ) ,LIMLOGN[LvlCode] )
RETURN
IF (
IF ( LVL1 >= LVL2; IF ( LVL1 >= LVL3; LVL1; IF ( LVL2 >= LVL3; LVL2; LVL3 ) ) )
< LVLTOT;
"Y";
"N"
)It should work.
If this works please accept it as a solution and also give KUDOS
Cheers
CheenuSing
Hi larabraghetti. I don't see anything explicitly defined for when LVL1 < LVL2, as in:
IF ( LVL1 >= LVL2; IF ( LVL1 >= LVL3; LVL1; IF ( LVL2 >= LVL3; LVL2; LVL3 ) ); LVL2 )
I'm also not sure how this would ever evaluate to anything but "N". Isn't a part of the whole always less than the whole? If you get the count of a column where the code is only 1, and then a count of the column where the code doesn't matter at all, wouldn't the second calculation always be greater than the first? Sorry if I'm missing something.