Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Q&A with Qlik - Qlik Cloud Migration: Questions about migrating to Qlik Cloud? Catch the latest replay!
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

Labels (1)
1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

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
Partner - Champion III
Partner - Champion III

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