Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts,
I have one folder. in folder i have" one excel file and one txt file" both files having same fields with different data.
Excel:-
ID NAME,AGE
1 Raj 21
2 Raja 22
Txt:-
ID NAME AGE
3 Krish 23
4 Krishna 24
Here my requirement is how can i load both files at a single load statement, is it possible ?
Regards
Mahesh
You can't address two input table sources (*) with a single LOAD statement, but you can concatenate your data into a single resident output table (either by autoconcatenation (same number and names of fields) or by using forced concatenation using CONCATENATE LOAD prefix).
edit:
(*)
You may think of using some kind of wildcards in your LOAD statement, but
- this will create also multiple statements by the QV script engine
- I don't think you can use wildcards here for the two distinct input formats.
The script:
Table:
LOAD ID,
Name,
Age,
'xlsx' as File
FROM
(ooxml, embedded labels, table is Sheet1);
Concatenate (Table)
LOAD ID,
Name,
Age,
'txt' as File
FROM
(txt, codepage is 1257, embedded labels, delimiter is spaces, msq);
The result:
The qvw is also attached with the data files.
Use Concatenate with the simple load excel and while load Notepad file use Spaces for Delemiter
Excel:
LOAD ID,
Name,
Age
FROM
[226916.xlsx]
(ooxml, embedded labels, table is Sheet1);
Concatenate (Excel)
LOAD [ID],
Name,
Age
FROM
[226916.txt]
(txt, codepage is 1252, embedded labels, delimiter is spaces, msq);
Hi Mahesh,
While you fetching data from any file type into qlikview
you can write loop statement for the same file type like(sheet 1,sheet 2....sheet n .xls) and it is not possible for different type of file types(1 is xls and 2nd is .txt,3rd is odbc...etc)
so it is not possible
coming to your data seems both are having same fields so automatically qlikview fallows Concatenation of 2 tables into one table no need to write the concatenate statement also
so output is created only one table with 4 rows.
Hi All,
Thanks for sharing Valuable information.
Regards
Mahesh
If you have found your answer could you please select the Correct answer. That will make the thread closed.
Thank you!
Hi Mindaugas ,
That is not possible in qlikview
what i need is i want to load two different format files into a single load statement .
It's possible qlikview979
You can add the two different data into script and can do forced concatenation then it will show in single table.
But you can't select two different formats data under single load statement.
Could please give a detail explanation about is your requirement.
Hi Vijay
I have one folder. in folder i have" one excel file and one txt file" both files having same fields with different data.
Excel:-
ID NAME,AGE
1 Raj 21
2 Raja 22
Txt:-
ID NAME AGE
3 Krish 23
4 Krishna 24
Here my requirement is how can i load both files at a single load statement, is it possible ?
Regards
Mahesh