Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am having same file but different file structure,
for example:
1) no1_a_31_12_2016
2) no1_no2_a_31_12_2016 (a=filename)
By using sub field i am taking date n filename.
I am receiving file structure mentioned above.i should get the file name for both structure(different structure)
Will u help me in this.
Thanks in advance.
Hi Sindhu ja,
Try this,
Load
Right(FileBaseName(),10) as Date,
Left(FileBaseName(), Len(FileBaseName()) - 11) as S.NO.
From Source;
If you want to format date field then use the below one.
Date(Date#(Right(FileBaseName(),10),'DD_MM_YYYY'),'Desired Format') as Date
Can you provide real data and expected result
This is the File Format..We are receiving from FTP.Based on this file structure,we are splitting the fields 1007 as s.no and & 29_3_2017 AS date. Filename as filename.
Instead of 1007 if we receive SOU4_1001 how can i get the field into script.we want to get both structure
you need SOU4_1001 value in s.no? or just want 1001??
Finally, You have this filelist in Field? I am assuming you must
Can you search on how SubField() function does in Qlikview
am not sure but you can use FilebaseName() function to get it.
load *,
filebasename() as Filename,
from....
Best
Chanty
Dear all.Thanks for ur rly.
I mean to say,
For Example;-
1001_29_03_2017
We are using subfield(filename,'_',1) as S.NO.
subfield(filename,'_',2) as day.
Month,Year viceversa
Here we are receiving 2 types of file structure. Script should Satisfies both type of file Structure.
For this "1001_29_03_2017 " the script is working fine.
when we receive this type of file structure its is taking 2nd position as day "SOU4_1007_29_03_2017".but here we need SOU4_1007 as S.No
Hi Sindhu ja,
Try this,
Load
Right(FileBaseName(),10) as Date,
Left(FileBaseName(), Len(FileBaseName()) - 11) as S.NO.
From Source;
If you want to format date field then use the below one.
Date(Date#(Right(FileBaseName(),10),'DD_MM_YYYY'),'Desired Format') as Date