Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

UNION ALL in SELECT Statement


Hi all,

Please advise on UNION All in Select query,How to use:

Select

Details1 as Details,

a,

b,

c

From A

UNION ALL

Select

Details2 as Details,

a,

b,

c

From B;

Above statement is not working in load script.

I want to extract data with a select statement

for performance tuning.

Thanks for help

Nitha

1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

Hi,

First load single table if it is loading single table, then include SQL keyword like below, hope this is the issue

Data:

SQL SELECT
  Details1 as Details,
  CONTROL_KEY ,
  PKEY,
  LKEY,
  '1’ as Identifier
  From RSID
UNION ALL
SELECT
  Details2 as Details,
  CONTROL_KEY ,
  PKEY,
  LKEY,
  '2' as Identifier 
FROM RSIF
UNION ALL
SELECT
  Details3 as Details,
  CONTROL_KEY ,
  PKEY,
  LKEY,,
  '3' as Identifier
FROM RSIG;


Regards,

Jagan.

View solution in original post

33 Replies
ashfaq_haseeb
Champion III
Champion III

Use Concatenate

Replacement for union

Select

Details1 as Details,

a,

b,

c

From A

concatenate

Select

Details2 as Details,

a,

b,

c

From B;

Regards

ASHFAQ

ecolomer
Master II
Master II

It is possible you ODBC non suport this.

Try with JOIN or CONCATENATE

rajeshvaswani77
Specialist III
Specialist III

Nitha,

Try the query first directly on the backed and see if it works?

What error message are you getting?

thanks,

Rajesh Vaswani

Anonymous
Not applicable
Author

Hi Ashfaq,

I want to extract data from multiple tables with select statement at the same time so data will be extracted in single table to qlikview.

so concatenate can be done only after extracting all tables to qlikview.

Thanks

Nitha

Anonymous
Not applicable
Author

Hi Rajesh,

Yes i have queried in backend and used same query in qlikview script.

But still it doesn't work

Thanks

Nitha

Anonymous
Not applicable
Author

There is no error and only first table is extracted

rbecher
MVP
MVP

What is the source database system?

- Ralf

Astrato.io Head of R&D
Anonymous
Not applicable
Author

Hi Ralf,

Its oracle.

rajeshvaswani77
Specialist III
Specialist III

Check if you have given SQL and terminated with quote. Otherwise it should work. Could be possibly to do with the driver then.

thanks,

Rajesh Vaswani