Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear users,
I want to know how I can give a field in my script a new value, according to a specific condition.
This is an excerpt of my script:
[Meldingen]:
LOAD
AutoNumber(JOB_NR) as %Melding.ID,
AutoNumber(JOB_CONTRACT_NR) as %Locatie.ID,
AutoNumber(JOB_SAP_REF_NR) as %SAP.ID,
JOB_NR as [Melding.Nummer],
JOB_DESC as [Melding.Omschrijving],
//ApplyMap('Map_Melding.Status', JOB_STATUS_NR) as [Melding.Status],
Date(Floor(JOB_DATE)) as [Melding.Datum gemeld],
Time(Frac(JOB_DATE)) as [Melding.Tijd gemeld],
Timestamp#(JOB_DATE, 'DD-MM-YYYY hh:mm:ss') as [Melding.Moment gemeld],
IF( IsNull("JOB_STATUS_NR"), 'Onbehandeld',
IF( ("JOB_STATUS_NR") = 'O3', 'Open staand',
IF( ("JOB_STATUS_NR") = 'O5', 'Afgehandeld',
IF( ("OIB_WorkFlowStatus") = 'status4',
'Afgehandeld mail', '<Onbekende status>'
)))) as [Melding.Status],
OIB_WorkFlowStatus,
ApplyMap('Map_Melding.Prioriteit', JOB_PRIORITY_NR) as [Melding.Prioriteit];
The code colored in blue is the relevant piece of code.
Normally, the column "JOB_STATUS_NR" can have the following values:
These values are replaced by the following: 'Onbehandeld', 'Open staand', 'Afgehandeld'.
I want to add a second value to the column, based on the value of an other field, namely IOB_WorkFlowStatus.
If this field has the value 'status4', I want to value 'Afgehandeld mail' to be placed in the column JOB_STATUS_NR.
How can I achieve this?
Try without double quotes around the fieldname.
Regards
Marco
This worked. Thanks!