Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

neetha_p
Honored Contributor

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
MVP
MVP

Re: UNION ALL in SELECT Statement

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.

33 Replies

Re: UNION ALL in SELECT Statement

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
Honored Contributor II

Re: UNION ALL in SELECT Statement

It is possible you ODBC non suport this.

Try with JOIN or CONCATENATE

rajeshvaswani77
Valued Contributor III

Re: UNION ALL in SELECT Statement

Nitha,

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

What error message are you getting?

thanks,

Rajesh Vaswani

neetha_p
Honored Contributor

Re: UNION ALL in SELECT Statement

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

neetha_p
Honored Contributor

Re: UNION ALL in SELECT Statement

Hi Rajesh,

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

But still it doesn't work

Thanks

Nitha

neetha_p
Honored Contributor

Re: UNION ALL in SELECT Statement

There is no error and only first table is extracted

MVP
MVP

Re: UNION ALL in SELECT Statement

What is the source database system?

- Ralf

neetha_p
Honored Contributor

Re: UNION ALL in SELECT Statement

Hi Ralf,

Its oracle.

rajeshvaswani77
Valued Contributor III

Re: UNION ALL in SELECT Statement

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

Community Browser