Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How can you make date from a following field
PerformanceLog_201103206565656565.tmp
How do you extract: 20110320 as date from above in (YYYYMMDD) format.
Thanks
Hi Hanns,
You can also try,
Date(Date#(left(Subfield('Field', '_',2),8),'YYYYMMDD'),'YYYYMMDD') as Date
How about this:
LOAD *,
Date#(KeepChar(Field,'0123'),'YYYYMMDD') as Field1
INLINE [
Field
PerformanceLog_201103206565656565.tmp
];
Hi,
Try this.
Load *,Date(Date#(Mid(Data,Index(Data,'_')+1,8),'YYYYMMDD')) as DATE inline [
Data
PerformanceLog_201103206565656565.tmp
];
Regards,
Kaushik Solanki
Kaushik, How about This?
LOAD *,
mid(Field,16, 8 ) as Field1
INLINE [
Field
PerformanceLog_201103206565656565.tmp
];
Hi Hanns,
You can also try,
Date(Date#(left(Subfield('Field', '_',2),8),'YYYYMMDD'),'YYYYMMDD') as Date
Hi Anil,
The expression is right, however whenever the text character changes, the script you wrote will fail.
So it is important to get the dynamic value. Have a look at the expression I gave, which is dynamic in nature.
Regards,
Kaushik Solanki
Hi,
another solution could be:
table1:
LOAD *,
Date#(Left(SubField(filename,'_',-1),8),'YYYYMMDD') as date
INLINE [
filename
PerformanceLog_201103206565656565.tmp
PerfLog_201204216565656565.tmp
Performance_Log_201305226565656565.tmp
];
hope this helps
regards
Marco