Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
gr_eldred
Creator II
Creator II

left join of two QVDS

Is there an error in this syntax? I need to make a left join between these two qvds.

Let vVtaSemanaDía = date(today(), 'YYYYMMDD');

tmp_vta_6W$(vVtaSemanaDía):

Load

%Pto_vta_ID,

Clasificación,

Cant_Estandar_Act6W

FROM

Transformación\Fact\tmp_Vta_Act_6W.qvd (qvd);

Left Join

LOAD

%Pto_vta_ID,

Clasificación,

Cant_Estandar_Ant6W

FROM

Transformación\Fact\tmp_Vta_Ant_6W.qvd (qvd);

Can you help me?

21 Replies
Anonymous
Not applicable

If all you REALLY need is to create a qvd with that name, it doesn't really matter what name is in your datamodel table.

Something like:

tmp_vta_6W:

Load

%Pto_vta_ID,

Clasificación,

Cant_Estandar_Act6W

FROM

Transformación\Fact\tmp_Vta_Act_6W.qvd (qvd);

Left Join(tmp_vta_6W)

LOAD

%Pto_vta_ID,

Clasificación,

Cant_Estandar_Ant6W

FROM

Transformación\Fact\tmp_Vta_Ant_6W.qvd (qvd);

let vQVDName='[..\1_QVDs\Transformación\Fact\Temp\tmp_vta_6W' & $(vVtaSemanaDía) & '.qvd]'

Store tmp_vta_6W into $(QVDName)(qvd);

maxgro
MVP
MVP

Let vVtaSemanaDía = date(today(), 'YYYYMMDD');

tmp_vta_6W$(vVtaSemanaDía):

Load

......

Left Join

......

STORE [tmp_vta_6W$(vVtaSemanaDía)] into [tmp_vta_6W$(vVtaSemanaDía).qvd] (qvd);




The syntax is correct

The Qvd is created

What's the problem?

gr_eldred
Creator II
Creator II
Author

hello again I just tried but still sending error in the flow does not find the QVD because I do not believe it.

tmp_vta_6W:

Load

%Pto_vta_ID,

Clasificación,

Cant_Estandar_Act6W

FROM

Transformación\Fact\tmp_Vta_Act_6W.qvd (qvd);

Left Join

LOAD

%Pto_vta_ID,

Clasificación,

Cant_Estandar_Ant6W

FROM

Transformación\Fact\tmp_Vta_Ant_6W.qvd (qvd);

let vQVDName='[..\1_QVDs\Transformación\Fact\Temp\tmp_vta_6W' & $(vVtaSemanaDía) & '.qvd]';

Store tmp_vta_6W into $(QVDName)(qvd);

gr_eldred
Creator II
Creator II
Author

can anybody help me?

Anonymous
Not applicable

So you're getting an error that

Transformación\Fact\tmp_Vta_Act_6W.qvd (qvd)

Does not exist?

gr_eldred
Creator II
Creator II
Author

if you do not create the qvd I need you to create the qvd of this table relationship

Anonymous
Not applicable

You're referring to the QVD in your script in all your posts.  If it doesn't exist yet, where are you inputting data from?

gr_eldred
Creator II
Creator II
Author

yes,  I need to generate a qvd of the relationship of these two tables and this same qvd use for the next flow, at the time of execution sends me an error that says: that the table does not exist.

Let vVtaSemanaDía = date(today(), 'YYYYMMDD');

tmp_vta_6W$(vVtaSemanaDía):

Load

%Pto_vta_ID,

Clasificación,

Cant_Estandar_Act6W

FROM

Transformación\Fact\tmp_Vta_Act_6W.qvd (qvd);

Left Join

LOAD

%Pto_vta_ID,

Clasificación,

Cant_Estandar_Ant6W

FROM

Transformación\Fact\tmp_Vta_Ant_6W.qvd (qvd);

Store tmp_vta_6W$(vVtaSemanaDía) into [..\1_QVDs\Transformación\Fact\Temp\tmp_vta_6W$(vVtaSemanaDía).qvd](qvd);

Anonymous
Not applicable

You say, "relationship of these two tables and this same qvd".  What tables and what qvd?  From your script, you're using 1 qvd to create 2 tables with the same data and joining them together.  And then creating another qvd with a different name.

Where is your source data?  What are you looking at to know that your column names are :

%Pto_vta_ID,

Clasificación,

Cant_Estandar_Ant6W

if the qvd doesn't exist yet?

gr_eldred
Creator II
Creator II
Author

This is the complete code.

I create a sales qvd with current year-- tmp_Vta_Act_6W:

I created a last year sales qvd-- tmp_Vta_Ant_6W:

I use a left join to cross these two qvds. The name of this Qvd needs to have a variable that brings the current date. --- tmp_vta_6W $ (vVtaSemanaDía):

(This is the Qvd that I can not generate)

The goal is to use this QVD tmp_vta_6W $ (vVtaSemanaDía):

to do the division

Cant_Estandar_Act6W / Cant_Estandar_Ant6W as Cant6W

and re-generate a Qvd with this operation.

of name --Vta_6W:

----------------------------------------------------------------------------------------------------------------------------------

Sub Master_Venta

Let MyMessage = ' ========================= Fact =========================';

trace $(MyMessage);

Let vVtaSemanaDía = date(today(), 'YYYYMMDD');

MaxTable:

LOAD

    Max(SemamaAñoApple_Numerado) as MaxValue

FROM

Transformación\Dim\CalendarioApple.qvd (qvd);

Let vMaxValue = Peek('MaxValue',0,'MaxTable');

//Año Actual

tmp_Vta_Act_6W:

LOAD %Pto_vta_ID,

    ApplyMap('Map_Clasific_art', %Art_ID,'N/A') as Clasificación,

    sum(Cantidad_Estandar) as Cant_Estandar_Act6W

FROM

Transformación\Fact\Temp\tmp_ventaspico_Test.qvd (qvd)

where

ApplyMap('Map_Calendario_Sem', Fecha,0)<=  $(vMaxValue)-1

and ApplyMap('Map_Calendario_Sem', Fecha,0)>= $(vMaxValue)-7

and WildMatch( ApplyMap('Map_Clasific_art', %Art_ID,'N/A'), 'Mac', 'Ipad', 'Iphone', 'Apple Watch', 'Accesorios Apple')

Group by %Pto_vta_ID,

ApplyMap('Map_Clasific_art', %Art_ID,'N/A')

;

Store tmp_Vta_Act_6W into [..\1_QVDs\Transformación\Fact\Temp\tmp_Vta_Act_6W.qvd](qvd);

//Año Anterior

tmp_Vta_Ant_6W:

LOAD %Pto_vta_ID,

    ApplyMap('Map_Clasific_art', %Art_ID,'N/A') as Clasificación,

    sum(Cantidad_Estandar) as Cant_Estandar_Ant6W

FROM

Transformación\Fact\Temp\tmp_ventaspico_Test.qvd (qvd)

where

ApplyMap('Map_Calendario_Sem', Fecha,0)<  $(vMaxValue)-53

and ApplyMap('Map_Calendario_Sem', Fecha,0)>= $(vMaxValue)-59

and WildMatch( ApplyMap('Map_Clasific_art', %Art_ID,'N/A'), 'Mac', 'Ipad', 'Iphone', 'Apple Watch', 'Accesorios Apple')

Group by %Pto_vta_ID,

ApplyMap('Map_Clasific_art', %Art_ID,'N/A')

;

Store tmp_Vta_Ant_6W into [..\1_QVDs\Transformación\Fact\Temp\tmp_Vta_Ant_6W.qvd](qvd);

//calculo 6 W

tmp_vta_6W$(vVtaSemanaDía):

Load

%Pto_vta_ID,

Clasificación,

Cant_Estandar_Act6W

FROM

Transformación\Fact\tmp_Vta_Act_6W.qvd (qvd);

Concatenate (tmp_vta_6W$(vVtaSemanaDía))

LOAD

%Pto_vta_ID,

Clasificación,

Cant_Estandar_Ant6W

FROM

Transformación\Fact\tmp_Vta_Ant_6W.qvd (qvd);

Store tmp_vta_6W$(vVtaSemanaDía) into [..\1_QVDs\Transformación\Fact\Temp\tmp_vta_6W$(vVtaSemanaDía).qvd](qvd);

Vta_6W:

Load

%Pto_vta_ID,

Clasificación,

date(Fecha_Acum) as Fecha_Fin_Semana,

Cant_Estandar_Act6W/Cant_Estandar_Ant6W as Cant6W

FROM

Transformación\Fact\tmp_vta_6W$(vVtaSemanaDía).qvd (qvd);

Store Vta_6W into [..\1_QVDs\Transformación\Fact\Temp\Vta_6W.qvd](qvd);

end SUB