Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi ,
i want to load data from 2 excel sheets names below.
1.2014 US REMS Audit Workbook DOL
2.2015 US REMS Audit Workbook DOL
Tab Names:
2014 Audit stats Tracking
2015 Audit stats Tracking
i want to combine data as a single Table with automation(Not Manual Concatenation)
OUTPUT Table contains 2014,2015 Audit stats Tracking Data
Thanks in advance
Hi Are BaBu,
I just added an extra If statement to check the file name. Check the attachment.
sub ScanFolder(Root)
for each FileExtension in 'xlsx'
for each FoundFile in filelist( Root & '\*.' & FileExtension)
Let vFileName = subfield('$(FoundFile)','\',SubStringCount('$(FoundFile)','\')+1);
if (Wildmatch(vFileName, '*US REMS Audit Workbook DOL*')) then
Let vYear = Left(vFileName,4);
Let vSheetName = vYear & ' Audit stats Tracking';
Data:
LOAD [Audit Date],
[DEA or NABP Number],
[Pharmacy ID],
[Pharmacy Name],
Address,
City,
State,
PharmacyTYpe,
LeadAuditor,
AuditType,
AccountManagerName,
MAAccountDirector,
[Product Audited],
[Overall Audit Result],
[Observation Rating],
[Observation Yes or No],
[Repeat Observations],
[Tier 1],
[Tier 2],
[Number of Counselors],
[Date Audit Report Issued],
[Date Response Received],
[Date Certificate Issued],
[Effectiveness Check],
Comments,
'$(vFileName)' as FileName
FROM [$(FoundFile)] (ooxml, embedded labels, table is '$(vSheetName)');
End If
next FoundFile
next FileExtension
end sub
Call ScanFolder('$(vFilePath)') ;
If the data fields are the same in the two excel files, then you can try this:
Table:
LOAD *
FROM *US REMS Audit Workbook DOL.xlsx;
Update: Sheet names need to be the same though
hi Sunny,
thanks for your time
fields are same so we can load with 201* like wild card search
But Tab names are Different
Tab Names:
2014 Audit stats Tracking
2015 Audit stats Tracking
here iam unable to use wild card;
Script:
FROM
(ooxml, embedded labels, table is [*Audit Stats Tracking]);
here 201* is working fine but in last line 2014,2015 Audit Stats Tracking i have to use wildcard
you can try with a small Loop
LET vTab = ' Audit stats Tracking';
LET vYear='2014'
for i=1 to 2
let vTest = vYear & vTab;
LOAD *
FROM
[...TEST.xlsx]
(ooxml, embedded labels, table is $(vTest));
Let vYear='2015'
next;
Hi
Thanks for your time
in future it may add 2016,2017,2018
is it works for future purpose?
Thanks
error: while reloading
it will work for future years as well
you only Need to Change within the Loop
Let vYear=vYear+1
and you Need to adapt the loopcounter
for i=1 to x
hi Rudolf,
can you please post sample application with my data.
i could not solve the issue
Thanks in advance;
see attached files
if you have further questions, come back to me
no attachment
please attach sample file
here are the files