Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
HI All,
I have a script like below,
Data:
LOAD [Col 1],
[Col 2],
[Col 3],
[Col 4],
[Col 5],
[Col 6],
[Col 7],
'Data 001' as Flag
FROM
Concatenate
LOAD [Col 1],
[Col 2],
[Col 3],
[Col 4],
[Col 5],
[Col 6],
[Col 7],
'Data 002' as Flag
FROM
Concatenate
LOAD [Col 1],
[Col 2],
[Col 3],
[Col 4],
[Col 5],
[Col 6],
[Col 7],
'Data 003' as Flag
FROM
STORE Data into FinalData.Qvd(Qvd);
My requireemen is to automate my loading is,
In my folder files are having like Data 001,Data 002,Data 003 and so on....
Now i am loading manually and creating flag with File name and storing into single file.
If i have 100 files in my folder i can't load them and create flag with file manually.
Can any one tell me how to write loops for this....?
THANKQ IN ADV
Data :
LOAD *,
FILENAME() as Flag;
SELECT *
FROM [QVDB].[dbo].[Data_*];
STORE Data into Data.Qvd(Qvd);
Actual My DB Table name will look like Data_001,Data_002 and so on.
My above script is not working..
Can anyone suggest how to do it ?
This works fine with flat files not with the DB!! you need write multiple load statements or stored proc for this
Hi,
Can you post the error which you are getting??
Regards,
If you have DB tables then use the Loop here for loading multiple loads from SQL DB.
Regards
Anand
you could try something like that, but the question is, where you get your max table number from:
for i=1 to 100
Data :
LOAD *,$(i) as Flag;
SQL
SELECT * FROM [QVDB].[dbo].[Data_$(i)];
NEXT
for i=1 to 100
Data :
LOAD *,$(i) as Flag;
SQL
SELECT * FROM [QVDB].[dbo].[Data_$(i)];
NEXT
Above code will execute 1 t0 100,
But If want to by user selection how to write a code for it...
Let say my user will say 4,17,31,65,89 etc to load.... will loop will work here ?
Please suggest some inputs here
In this case, You have to load the entire data from DB and need to apply the filter in Where Clause or in front end.
Is there any other solution?
we talk about users @ QlikView SERVER?