Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to insert a field to distinguish a select

Hi ,

I have this script which stacks six loads into only one (they all have the same columns) whithout distinguish among them.

ODBC CONNECT32 TO [dBASE Files];

SQL SELECT *

FROM `Y:\EMP83`\diario;

SQL SELECT *

FROM `Y:\EMP84`\diario;

SQL SELECT *

FROM `Y:\EMPD2`\diario;

SQL SELECT *

FROM `Y:\EMPD3`\diario;

SQL SELECT *

FROM `Y:\EMPY1`\diario;

SQL SELECT *

FROM `Y:\EMPY2`\diario;

How could I join an extra field called 'name' to write in it 'EMP83' for first select rows, ' EMP84' for second select rows... and so on?

Thanks

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Add a literal string as value for the name field:

SQL SELECT *, 'EMP83' as name

FROM `Y:\EMP83`\diario;

SQL SELECT *, 'EMP84' as name

FROM `Y:\EMP84`\diario;

etc...


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

Add a literal string as value for the name field:

SQL SELECT *, 'EMP83' as name

FROM `Y:\EMP83`\diario;

SQL SELECT *, 'EMP84' as name

FROM `Y:\EMP84`\diario;

etc...


talk is cheap, supply exceeds demand
Not applicable
Author

Thank you very much