I've created a program with some program stages.
When I create a program indicator using the function d2:condition,
the result is not what I'm expected.
Example in the expression field :
- d2:condition('1 > 0',1,0) => result "false".
- d2:condition('#{w7N4mScR2g6.Sv4bRYIiSHy} == true',1,0) => result
"false" (#{w7N4mScR2g6.Sv4bRYIiSHy} having a "true" value)
Am not sure if this is what you mean but I had an experience where program indicators with the d2:condition function always evaluated to “false” when displayed in the tracker.
You may want to try using the ternary conditional operator instead:
condition ? if_true : if_false
So your first expression will look like this…
1 > 0 ? 1 : 0
The result will be 1 since the expression (1 > 0) evaluates to true.
Am not sure if this is what you mean but I had an experience where program indicators with the d2:condition function always evaluated to “false” when displayed in the tracker.
You may want to try using the ternary conditional operator instead:
condition ? if_true : if_false
So your first expression will look like this…
1 > 0 ? 1 : 0
The result will be 1 since the expression (1 > 0) evaluates to true.