Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Fellas ,
A newbie here . I want to create two new fields and repeat values in those . This being unkown domein fr me , if this gonna be huge script ?
Sourcing data
ID | DC | IPUAC | CLASS |
S1 | DC1 | alpha-keto | first |
S1 | DC2 | second | |
S1 | DC3 | third | |
S1 | DC4 | fourth | |
S2 | DC1 | first | |
S2 | DC2 | omega-keto | second |
S3 | DC1 | third | |
S3 | DC2 | fourth | |
S3 | DC3 | first | |
S3 | DC4 | alpha-cyclic | second |
S3 | DC5 | second |
Out data
ID | DC | IPUAC | CLASS | ROR | NEWFIELD1 | NEWFIELD2 |
S1 | DC1 | alpha-keto | first | 0.8 | alpha | keto |
S1 | DC2 | second | 0.2 | alpha | keto | |
S1 | DC3 | third | 0.5 | alpha | keto | |
S1 | DC4 | fourth | 0 | alpha | keto | |
S2 | DC1 | first | 0.8 | omega | keto | |
S2 | DC2 | omega-keto | second | 0.2 | omega | keto |
S3 | DC1 | third | 0.8 | alpha | cyclic | |
S3 | DC2 | fourth | 0.2 | alpha | cyclic | |
S3 | DC3 | first | 0.5 | alpha | cyclic | |
S3 | DC4 | alpha-cyclic | second | 0 | alpha | cyclic |
S3 | DC5 | second | 0.8 | alpha | cyclic |
hi,
1. is it Straight table?
2. what based you have give value as alpha?
In a new section in your load below your original you could try the following:
Finaltab:
Load
*,
SubField(IPUAC_temp,'-',1)as NewField1,
SubField(IPUAC_temp,'-',2)as NewField2
;
Load
*,If(Len(Trim(IPUAC)), IPUAC, Peek(IPUAC_temp)) AS IPUAC_temp
;
Load
*
Resident YOURTABLENAME
order by IDnew asc, IPUAC desc ;
Drop Table YOURTABLENAME;
My results from using the above.