Forum Discussion
Jo5hua22
4 years agoHelper I
Consecutive value being checked
Hi, I would like your help to determine the below logic in the screenshot. Which is when there are consecutive values of "R" (more than 1 time) then the output should be displayed as "CHECK" ...
- 4 years ago
I found the answer
Output =
var _seq = [S.No]
var _last = countx(filter(Table, Table[S.No] = _seq -1 && [KPI] = "R"),[S.No])
var _Next = countx(filter(Table, Table[S.No] = _seq +1 && [KPI] = "R"),[S.No])
return
Switch(True() ,
[KPI] = "R" && isblank(_last) && isblank(_next) , "No Check",
[KPI] = "R" &&((not(isblank(_last)) && isblank(_next))||(not(isblank(_last)) && not(isblank(_next)))), "Check",
blank())
Jo5hua22
4 years agoHelper I
I found the answer
Output =
var _seq = [S.No]
var _last = countx(filter(Table, Table[S.No] = _seq -1 && [KPI] = "R"),[S.No])
var _Next = countx(filter(Table, Table[S.No] = _seq +1 && [KPI] = "R"),[S.No])
return
Switch(True() ,
[KPI] = "R" && isblank(_last) && isblank(_next) , "No Check",
[KPI] = "R" &&
((not(isblank(_last)) && isblank(_next))||(not(isblank(_last)) && not(isblank(_next))))
, "Check",
blank())