Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Read data from mutiple xls files and load data in DB table

Rohan2020
7 - Meteor

Hello Everyone,

 

I need one suggestion on implementing one functionality.  I am reading data from multiple excel  file using macros and loading data in table. The header of the of the the of log files are changing but need to concatenate data at row level and store in table. Getting issue when trying to map these excel column to DB table as it is changing for each file.

 

E.g Sample 1 excel input file

Column 1 Column 2Column 3Column 4
abcd
efgh

 

Sample 2 excel input file

Column 5Column 6Column 7Column 8
ijkl

 

 

Structure of database table to load data from above two sample file.

Log_FilenameValue 1Value 2
Sample 1a|b|c|d|e
Sample 1e|f|g|h 
Sample 3i|j|k 
8 REPLIES 8
Qiu
21 - Polaris
21 - Polaris

@Rohan2020 
Not the Macro part though, just an idea may help.

1210-Rohan2020.PNG

Rohan2020
7 - Meteor

As I have multiple sheet using macros to read the excel file. Need to concatenate at the row level and also same need to be stored in DB but as the column names are dynamic it is not getting mapped. In total i have 65 files to process but file have different header.

Qiu
21 - Polaris
21 - Polaris

@Rohan2020 

In my workflow, all the data header will be forced to be Value 1, 2, 3 and so on.

Rohan2020
7 - Meteor

In DB tables need to load data in this format in separate rows as below . Please suggest on this.

 

Log_FilenameValue
Sample 1a|b|c|d|e
Sample  1e|f|g|h
Sample 3i|j|k
Qiu
21 - Polaris
21 - Polaris

@Rohan2020 
Seems I did something not necessary😁

1210-Rohan2020-1.PNG

Rohan2020
7 - Meteor

Rohan2020_0-1607580410130.png

 I am getting this error message.

grazitti_sapna
17 - Castor

Hi @Rohan2020 ,can you give this a try, if it works for you?

 

grazitti_sapna_0-1607585307651.png

As you are reading the data using macro and facing an issue of different column names. Try using a directory tool by keeping all the files at same location unless you are using a different source to read them.

Also change the location of the directory tool to your directory.

 

If this works kindly mark this post as solution.

 

Thanks.

 

Sapna Gupta
Rohan2020
7 - Meteor

I am using macro as the directory is changing based on the batch run. Also when storing data in Oracle DB need to unique number generator. Also while appending the value in case last column is null can we append NULL.

Labels