Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have a string format with April_2016-2017
need to convert to different formats
i,e 2016-2017
April
2016
2017
Thank you
LOAD DISTINCT SubField(SubField(SubField(Field,'_'),'-')&'|'&SubField(Field,'_',-1),'|') as Field
INLINE [
Field
April_2016-2017
];
What is the output you want to get from April_2016-2017?
i need 3 different formats
2016-2017
April
2016
did u try this?
dat:
LOAD * INLINE [
F1
April_2016-2017
];
LOAD *,
subfield(F1, '_' ,1) as 1,
subfield(F1, '_' ,2) as 2,
SubField(F1,'-',3) as 3
Resident dat;
no its not working
May be
LOAD SubField(SubField(Field,'_'),'-') as Field
INLINE [
Field
April_2016-2017
];
Perhaps this is what you seek:
data:
LOAD * INLINE [
field
April_2016-2017
];
test:
LOAD
*,
subfield(field, '_' ,2) as YearRange,
subfield(field, '_' ,1) as Month,
subfield(subfield(field, '_' ,2), '-', 1) as FirstYear
Resident data;
LOAD DISTINCT SubField(SubField(SubField(Field,'_'),'-')&'|'&SubField(Field,'_',-1),'|') as Field
INLINE [
Field
April_2016-2017
];