Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I wanted to replace the values in my script .The value fields in Severity table were 1,2,3,4 I want to replace the same with High','Medium','Low','very Low'I changed severity in Load as pick(match(Severity,'1','2','3','4'),'High','Medium','Low','very Low') .The output is as shown above.Can you let me know how can i replace all the values in severity columns with names? or is there any other method?
LOAD id,
tktid,
CreateDate,
Updaterid,
Name,
EngagementType,
pick(match(Severity,'1','2','3','4'),'High','Medium','Low','very Low') ,
BIZHrMinBetween,
SLA,
ticketform,
Coverage,
CalMinBetween,
old_sla;
[ticket_status_sla]:
SELECT id,
tktid,
CreateDate,
Updaterid,
Name,
EngagementType,
ServiceType,
Severity,
BIZHrMinBetween,
SLA,
ticketform,
Coverage,
CalMinBetween,
`old_sla`
FROM `ticket_status_sla`;
[ticket_status_sla]:
LOAD id,
tktid,
CreateDate,
Updaterid,
Name,
EngagementType,
pick(Severity,'High','Medium','Low','very Low') as Severity,
BIZHrMinBetween,
SLA,
ticketform,
Coverage,
CalMinBetween,
old_sla;
SELECT id,
tktid,
CreateDate,
Updaterid,
Name,
EngagementType,
ServiceType,
Severity
BIZHrMinBetween,
SLA,
ticketform,
Coverage,
CalMinBetween,
`old_sla`
FROM `ticket_status_sla`;
Hi Gysbert,
The code is not working ,Are you sure the changes have to be under select ID AND NOT load ?
Can you try this:
LOAD id,
tktid,
CreateDate,
Updaterid,
Name,
EngagementType,
Pick(Severity * 1,'High', 'Medium', 'Low', 'Very Low') as Severity,
BIZHrMinBetween,
SLA,
ticketform,
Coverage,
CalMinBetween,
old_sla;
SELECT id,
tktid,
CreateDate,
Updaterid,
Name,
EngagementType,
ServiceType,
Severity,
BIZHrMinBetween,
SLA,
ticketform,
Coverage,
CalMinBetween,
`old_sla`
FROM `ticket_status_sla`;
Hi Sunny,
It dosent work as well.It is giving the same output as mentioned above.Also,We need to specify which values to replace.I think it can be done by if statement to .
Is there another table where you might have Severity which need a similar Pick() statement?
Please try the following:
If( Match( [your_value_field] , 1), 'High',
If(Match( [your_value_field], '2'), 'Medium',
If(Match( [your_value_field], '3'), 'Low', 'very Low')
)
) as your_replace_field ,
Hi Haikuo,
The code is working fine if I am using different names for "your_value_field" and "your_replace_field".
If( Match( [Severity] , 1), 'High',
If(Match( [Severity], '2'), 'Medium',
If(Match( [Severity], '3'), 'Low',
If(Match( [Severity], '4'),'vl')
))
) as SeverityNew,
This is making new field.I want to replace the data in the severity table.
If I am using the SeverityNew as Severity the code is still showing output as attached in the question above.