Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
alwinsch
Creator
Creator

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
Partner - Master II
Partner - Master II

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.

View solution in original post

6 Replies
Not applicable

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
Partner - Master II
Partner - Master II

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

it is the best idea i think

alwinsch
Creator
Creator
Author

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
Contributor III
Contributor III

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
Partner - Master II
Partner - Master II

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.