Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have on excel which contains the columns as below
Messageno | nature | priority |
---|---|---|
1 | assistance | 1 |
2 | correction | 2 |
3 | evolution | 3 |
4 | project | 4 |
while loading the data i would like another column to be added dynamically with the column nameticket_type and with few conditions like:
1. if in nature column value is assistance and correction then in column ticket_type fopr corresponding record it should be incident.
2. if in nature column value is evolution then in column ticket_type fopr corresponding record it should be changemgmt.
3. if in nature column value is project then in column ticket_type fopr corresponding record it should be project.
After loading the data should be loaded in this way
Messageno | nature | priority | ticket type | |
---|---|---|---|---|
1 | assistance | 1 | incident | |
2 | correction | 2 | incident | |
3 | evolution | 3 | changemgmt | |
4 |
| 4 | project | |
Thanks in advance
Venu
Venu, Please find below the script for your current requirement. I hope this helps.
TableXYZ:
LOAD Messageno,
nature,
priority,
if(nature = 'assistance' or nature = 'correction', 'incident',
if(nature = 'evolution', 'changemgmt',
if(nature='project','project'))) AS ticket_type
FROM
TABLE xyz.qvd;
If you are going to have multiple values, then form an inline table with two fields nature, ticket_type and use applymap in the load script. (or) You can join the table with ticket_type with your TableXYZ and still get the ticket_type field in your table.
Venu, Please find below the script for your current requirement. I hope this helps.
TableXYZ:
LOAD Messageno,
nature,
priority,
if(nature = 'assistance' or nature = 'correction', 'incident',
if(nature = 'evolution', 'changemgmt',
if(nature='project','project'))) AS ticket_type
FROM
TABLE xyz.qvd;
If you are going to have multiple values, then form an inline table with two fields nature, ticket_type and use applymap in the load script. (or) You can join the table with ticket_type with your TableXYZ and still get the ticket_type field in your table.