Forum Discussion
RANKX Issues with 0s
FreemanZ That works for when I am not working in a matrix. I should have made this more clear. I have a matrix with both program and subprogram, and I need to have a rank for each. So the formula that I am actullay using looks like the below
RANK =
VAR _program = RANKX(ALLSELECTED( [Program]), [NUMBER],,ASC)
VAR _subProgram = RANKX(ALLSELECTED( [subProgram]), [NUMBER],,ASC)
RETURN
if(isinscope(program),_program,if(isinscope(subProgram),_subProgram))
This returns a proper rank for the program, but the subProgram has all the same rank
- amitchandak3 years ago
Super User
Moonc , if both are on row and program is first and sub program is second then try like
RANK =
VAR _program = RANKX(ALLSELECTED( [Program]), [NUMBER],,ASC)
VAR _subProgram = RANKX(ALLSELECTED( [subProgram]), [NUMBER],,ASC)
Switch (True()
isinscope(subProgram,_subProgram,
isinscope(program),_program
)
The first one or the parent is always isinscope for the child
IsInScope - Switch Rank at different levels: https://youtu.be/kh0gezKICEM
- Moonc3 years agoFrequent Visitor
amitchandak This does not work, I am seeing the program ranks correct, but the subprogram ranks are incorrect. I don't see any pattern in the rank that would help me understand.