Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

alwinsch
Not applicable

Create QVD file from 3 SQL queries

Hi,

I have 3 sql statements.

for example

Customer:

select * from customers

product:

select * from products

salesperson

select * from sales

store customer into test.qvd;

store product into test.qvd;

store salesperson into test.qvd;

my test.qvd file has only the data from salesperson.

I want all the data in one QVD file...

Is this possible?

Thanks.

A.

1 Solution

Accepted Solutions
giakoum
Not applicable

Re: Create QVD file from 3 SQL queries

OneTable :

sql select *, 'Customer' as Origin from customers;

concatenate (OneTable)

sql select *, 'Product' as Origin from products;

concatenate (OneTable)

sql select *, 'Sales' as Origin from sales;

Just be carefull. If the queries return common field names, they will be handled as one field. Maybe it is better to replace * with specific field names.

6 Replies
Not applicable

Re: Create QVD file from 3 SQL queries

it is not possible

qvd is one table (allways)

you can store it in qvw file (but then you could do only binary load all the tables from qvw file )

giakoum
Not applicable

Re: Create QVD file from 3 SQL queries

You also could concatenate the 3 tables into one and then store it. Add a field which you can use to distinguish the records from each table, for example 'Customers' as [Origin Table].

Not applicable

Re: Create QVD file from 3 SQL queries

it is the best idea i think

alwinsch
Not applicable

Re: Create QVD file from 3 SQL queries

Can you give a little example.

Because i don't know what you mean.

I created 3 tables

and how to concatenate?

Or is it better to try and edit my sql script so i have one table in origin?

carloshernandez
Not applicable

Re: Create QVD file from 3 SQL queries

Hello, in my opinion I think it would be easier to unite the pair sql query you have only one table, I can think of something like

Cliente:

select clientes.Cliente,clientes.Nombre,clientes.(loscampos que quieras de la tabla cliente),

             productos.Producto,productos.Descripcion,productos.(loscampos que quieras de la tabla Productos),

             venta.Movimiento,venta.NumerodeMovimiento,venta.Fechaemision

from clientes,productos,venta

where

                    Venta.Cliente=Clientes.Cliente AND Venta.Producto=Productos.Producto

Assuming ls tables can be linked via any of the equations where after the end of

I hope you serve

regards

giakoum
Not applicable

Re: Create QVD file from 3 SQL queries

OneTable :

sql select *, 'Customer' as Origin from customers;

concatenate (OneTable)

sql select *, 'Product' as Origin from products;

concatenate (OneTable)

sql select *, 'Sales' as Origin from sales;

Just be carefull. If the queries return common field names, they will be handled as one field. Maybe it is better to replace * with specific field names.