Writing Validation

Hi.
The Question is: Record the amount of Income from work last month for

  • Paid employment
  • Income from self-employment

Now this question is linked to other questions

Main Job
Q2.1 During the reference week (….), did you do any work for pay, profit or family gain, even if it was only for one hour? 1Yes 2 No

Q2.11 Employment Status

  • Employer
  • Own account worker
  • Employee
  • Apprentice/internship
  • Contributing family worker
  • Other, specify ……….

Q2.14 Gross Income (Amount):
Secondary Job

Q2.17 Employment Status

  • Employer
  • Own account worker
  • Employee
  • Apprentice/internship
  • Contributing family worker
  • Other, specify ……….

What have been done so far

Paid Job
Validation condition1
labourRoster.Any(x=>(x.time??0) > 1 || (x.worked??0) == 2 && (x.workInRefWeek??0)==2 || (x.otherWorkInRefWeek??0)==2 || (x.absentFromWork??0)==2) ? self == 0 : true

msg1
%labourRoster% is not an ELIGIBLE member. Revise answer

Validation condition2
labourRoster.Any(x=> (x.workInRefWeek??0)==1 && (x.empStatusMainJob.InList(1,2)) || (x.empStatusInOtherJob.InList(1,2)) && (x.income??0) > 0 ) ? self == 0: true

msg2
No information in labour force, states that %labourRoster% received income from paid employment last month

Validation condition3
labourRoster.Any(x=> (x.workInRefWeek??0)==1 && (x.empStatusMainJob.InList(3,4,5)) || (x.empStatusInOtherJob.InList(3,4,5))&& (x.income??0) > 0 ) ? self > 0: true

msg3
%labourRoster% received income from paid employment last month. Revise answer

Income from self-employment
Validation condition1
labourRoster.Any(x=> (x.empStatusMainJob.InList(1,2)) || (x.empStatusInOtherJob.InList(1,2)) && (x.income??0) > 0 ) ? self != 0: true

msg1
%labourRoster% received income from self-employment last month. Revise answer

Validation condition2
labourRoster.Any(x=>(x.empStatusMainJob.InList(3,4,5)) || (x.empStatusInOtherJob.InList(3,4,5)) && (x.income??0) > 0 ) ? self == 0: true

msg2
No information in labour force, states that %labourRoster% received income from self-employment last month

//My issue is that when a Respondent is working two jobs, the main job as an employee and the second one as an own account worker. The result is below

image

Please help!!
Thanks
Bharati

very long and complicated description. please simplify.

@peterbrueckmann would you be able to help?

My issue is that when a Respondent is working two jobs, for instance as an employee for her main job and as an own account worker for the secondary job.

Please observe the validation conditions 2 and 3 for paid job cover for both paid and self employed job. Now, as said above the Respondent is working two jobs, so when record her paid job, a warning message relating to condition 3 will be displayed as illustrated in the above pic. Grateful if you could assist on this particular issue.

Useful Note:
self employment (employment status = employer/own account worker)
Q2.1 During the reference … (variable name: workInRefWeek)
Q2.11 Employment Status (variable name: empStatusMainJob)
Q2.17 Employment Status (variable name: empStatusInOtherJob)
Please ignore the validation condition 1 under Paid employment

Regards,
Bharati

If @sergiy thinks its too complex I definitely also can’t help much =).

What I thought browsing through the complex description:

Validation condition2
labourRoster.Any(x=> (x.workInRefWeek??0)==1 && (x.empStatusMainJob.InList(1,2)) || (x.empStatusInOtherJob.InList(1,2)) && (x.income??0) > 0 ) ? self == 0: true

msg2
No information in labour force, states that %labourRoster% received income from paid employment last month

This sounds not like a validation condition but just enabling conditions. Just ask questions if they make sense to ask. You need to adjust the syntax of course. But your structure with rosters and questions is not clear to the reader to give you any help.

And for:

Validation condition3
labourRoster.Any(x=> (x.workInRefWeek??0)==1 && (x.empStatusMainJob.InList(3,4,5)) || (x.empStatusInOtherJob.InList(3,4,5))&& (x.income??0) > 0 ) ? self > 0: true

msg3
%labourRoster% received income from paid employment last month. Revise answer

You only enable the question if they stated to have worked in paid employment. In that case a simple self>0 is sufficient as validation condition.

Besides that, simplify the description…
Best
Peter