← Back to team overview

dhis2-devs team mailing list archive

Re: Validation rule with yes/no and number

 

This is sort of like designing a complicated apparatus for a really simple
problem.

I sort of see the issue, but am not really sure if you mean a "true/false"
data element as opposed to a yes/no. If you use "Yes only", then the value
will be non-null only when checked. If so, then the compulsory pair should
work.

Regards,
Jason





On Mon, May 5, 2014 at 11:26 PM, Olav Poppe <olav.poppe@xxxxxx> wrote:

> Sorry, forgot to reply to your earlier suggestion Jason. Agree that it is
> no really necessary, but it can be difficult to convince people of that…
>
> As for the compulsory pair, I though that would only ensure that there is
> some value in both fields - but what I need is to ensure that if A is «no»,
> the B SHOULD be empty - and if a is «yes», it should NOT be empty. Can I do
> that with a compulsory pair?
>
>
> 5. mai 2014 kl. 15:50 skrev Lars Helge Øverland <larshelge@xxxxxxxxx>:
>
> Agree with Jason here.
>
> Olav the "compulsory pair" operator for validation rules could be useful
> here.
>
> Lars
>
>
>
> On Fri, May 2, 2014 at 3:14 PM, Jason Pickering <
> jason.p.pickering@xxxxxxxxx> wrote:
>
>> Not sure if the "Compulsory pair" works for this case, but it should.
>>
>> On the other hand, it would seem little point to record Element A, as if
>> Element B is non-zero, it already indicates that there was a stockout.
>>
>> Regards,
>> Jason
>>
>>
>>
>> On Fri, May 2, 2014 at 7:39 PM, Olav Poppe <olav.poppe@xxxxxx> wrote:
>>
>>> Hi,
>>> is it possible to create a validation rule with a yes/no data element
>>> and number type data element?
>>>
>>> For example:
>>> Element A: Was the facility out of stock?
>>> Element B: If yes, for how many days?
>>>
>>> I would like to validate that Element B is only filled if the value for
>>> Element A is yes. Is this possible?
>>>
>>> Regards,
>>> Olav
>>>
>>> _______________________________________________
>>> Mailing list: https://launchpad.net/~dhis2-devs
>>> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
>>> Unsubscribe : https://launchpad.net/~dhis2-devs
>>> More help   : https://help.launchpad.net/ListHelp
>>>
>>
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~dhis2-devs
>> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~dhis2-devs
>> More help   : https://help.launchpad.net/ListHelp
>>
>>
>
>

Follow ups

References