Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I Have a question about a range field:
| Real | Destiny | Counters |
| 21/08/2018 2:23 | DFW | B26-B30 |
I need to spli the counters field into the values that I have in the range Example B26 - B30
Result Table:
| Real | Destiny | Counters |
| 21/08/2018 2:23 | DFW | B26 |
| 21/08/2018 2:23 | DFW | B27 |
| 21/08/2018 2:23 | DFW | B28 |
| 21/08/2018 2:23 | DFW | B29 |
| 21/08/2018 2:23 | DFW | B30 |
Do you think it's possible to do in the script?
Thanks
Something like this
Table:
LOAD *,
Prefix & (Start + IterNo() - 1) as Counters_New
While Start + IterNo() - 1 <= End;
LOAD *,
PurgeChar(SubField(Counters, '-', 1), '0123456789') as Prefix,
KeepChar(SubField(Counters, '-', 1), '0123456789') as Start,
KeepChar(SubField(Counters, '-', 2), '0123456789') as End;
LOAD Real,
Destiny,
SubField(Counters, ',') as Counters;
LOAD * INLINE [
Real, Destiny, Counters
21/08/2018 2:23, DFW, "A1-A2,B26-B30"
];
Try something like this
Table:
LOAD *,
Prefix & (Start + IterNo() - 1) as Counters_New
While Start + IterNo() - 1 <= End;
LOAD *,
PurgeChar(SubField(Counters, '-', 1), '0123456789') as Prefix,
KeepChar(SubField(Counters, '-', 1), '0123456789') as Start,
KeepChar(SubField(Counters, '-', 2), '0123456789') as End;
LOAD * INLINE [
Real, Destiny, Counters
21/08/2018 2:23, DFW, B26-B30
21/08/2018 2:23, DFW, BD26-BD30
];
Thanks,
It work! sorry to bother you but I encounter with one condition about this range, That in te Field I can have 2 different ranges like:
A1-A2,B26-B30
In that case how can I do?
Thank you
Something like this
Table:
LOAD *,
Prefix & (Start + IterNo() - 1) as Counters_New
While Start + IterNo() - 1 <= End;
LOAD *,
PurgeChar(SubField(Counters, '-', 1), '0123456789') as Prefix,
KeepChar(SubField(Counters, '-', 1), '0123456789') as Start,
KeepChar(SubField(Counters, '-', 2), '0123456789') as End;
LOAD Real,
Destiny,
SubField(Counters, ',') as Counters;
LOAD * INLINE [
Real, Destiny, Counters
21/08/2018 2:23, DFW, "A1-A2,B26-B30"
];