Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Peony
Creator III
Creator III

Concatenate issue for tables in the loop

Hi everyone. 

I have an issue with tables concatenation. I have a list of .qvds that looks like next one:

Z1:
Load * Inline [
A, B, C
3, 4, 5
];
Store Z1 into '$(vTargetPath)'Z1.qvd];
Drop Table Z1;

Z2:
Load * Inline [
A, B, C, D
3, 7, 10, 12
];

Store Z2 into '$(vTargetPath)'Z2.qvd];
Drop Table Z2;

I take all tables using For - Next loop.

For Each File in Filelist('$(vTargetPath)Z*.qvd')
TMP: 
Load *
From [$(File)](qvd);
Next File

 

And I need to have all the tables i load in one big TMP table. But instead of it I got TMP and TMP-1 tables for Z1 and Z2 qvds.  How do I may concatenate tables with different amount of fields inside the loop?

Labels (2)
1 Solution

Accepted Solutions
Taoufiq_Zarra

@Peony 

concatenation is not automatic since you do not have the same columns.

but you can always do that trick

TMP:
load * inline [
TmpField
];


For Each File in Filelist('$(vTargetPath)Z*.qvd')
TMP: 
concatenate(TMP)
Load *
From [$(File)](qvd);
Next File;

drop fields TmpField;

 

output :

Capture.PNG

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉

View solution in original post

3 Replies
Taoufiq_Zarra

@Peony 

concatenation is not automatic since you do not have the same columns.

but you can always do that trick

TMP:
load * inline [
TmpField
];


For Each File in Filelist('$(vTargetPath)Z*.qvd')
TMP: 
concatenate(TMP)
Load *
From [$(File)](qvd);
Next File;

drop fields TmpField;

 

output :

Capture.PNG

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
Peony
Creator III
Creator III
Author

@Taoufiq_Zarra  Thank you very much for your help. This solution is perfect. 

durgadevikumar1
Contributor
Contributor

@Taoufiq_Zarra  awesome, it is really helpful nd nice trick