Hi everyone
I am trying to evaluate the entire below expression of 4 program variables to either a 0 or 1. My countIfValue functions shown below are successfully generating individual 0’s and 1’s, and by dividing by 4 I am able to limit the possible values to 0, 0.25, 0.5, 0.75 and 1
From here I am trying to apply a d2:ceil function so any value > 0 gives a 1.
(d2:countIfValue( ‘F5.1 ALx1 ruptura de stock’, ‘SIMNAO_NA_NAO’ ) + d2:countIfValue( ‘F5.2 ALx2 ruptura de stock’, ‘SIMNAO_NA_NAO’ ) + d2:countIfValue( ‘F5.3 ALx3 ruptura de stock’, ‘SIMNAO_NA_NAO’ ) + d2:countIfValue( ‘F5.4 ALx4 ruptura de stock’, ‘SIMNAO_NA_NAO’ ))/4.0
When I try to nest this function in d2:ceil ( <> ) however I am only getting blank outputs. I’ve played around with the placement of additional ( ) but have not been able to get this to work.
d2:ceil((d2:countIfValue( ‘F5.1 ALx1 ruptura de stock’, ‘SIMNAO_NA_NAO’ ) + d2:countIfValue( ‘F5.2 ALx2 ruptura de stock’, ‘SIMNAO_NA_NAO’ ) + d2:countIfValue( ‘F5.3 ALx3 ruptura de stock’, ‘SIMNAO_NA_NAO’ ) + d2:countIfValue( ‘F5.4 ALx4 ruptura de stock’, ‘SIMNAO_NA_NAO’ ))/4.0)
Does anyone have any insight on the d2:ceil function here, or another approach? Essentially if ANY of the 4 program rule variable in the expression == ‘SIMNAO_NA_NAO’ I want to generate a 1, and if NONE of them are I want to generate a 0 for use in a larger formula