Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

FROM SQL TO SCRIPT .... very difficult matter:

I need to convert this sql query in a load script:

SELECT

CGANA00F.CONTCA AS C_DESTINATARIO_TEMP,

CGANA03F.ITSTAD AS C_PUNTO_VENDITA_TEMP

FROM CGANA00F

LEFT OUTER JOIN CGANA03F ON

CGANA00F.CDDTCA = CGANA03F.CDDTAD AND

CGANA00F.CONTCA = CGANA03F.CONTAD

WHERE

CGANA03F.ITSTAD <> ' '

here my try:

TAB_1:

LOAD CONTCA AS C_DESTINATARIO_TEMP,

  CDDTCA AS key_J ;

//FROM [..\QVD_EME\CGANA00F.QVD] (qvd);

SELECT * FROM CGANA00F;

LEFT JOIN LOAD

CONTAD AS C_DESTINATARIO_TEMP,

ITSTAD AS C_PUNTO_VENDITA_TEMP,

CDDTAD AS key_J ;

SELECT * FROM CGANA03F

// FROM [..\QVD_EME\CGANA03F.QVD]   (qvd)

WHERE ITSTAD <> ' ' ;

DROP FIELD key_J;

but it doesn't work ...

Can you help me?

10 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

HI,

     Try this.

    

Data:
Load
CONTCA
Autonumber(CONTCA &'/'& CDDTCA) as Key

From CGANA00f.qvd

Left outer join

Load
ITSTAD
Autonumber(CONTCA &'/'& CDDTCA) as Key
From CGANA03f.qvd
Where ITSTAD <> ''

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

i TRIED WITH THIS SCRIPT BUT IT DOESN'T WORK:

TAB_1:

LOAD CONTCA AS C_DESTINATARIO_TEMP,

 

AUTONUMBER(CDDTCA&'-'&CONTCA) AS CHIAVE_J ;

//FROM [..\QVD_EME\CGANA00F.QVD] (qvd);

SELECT * FROM CGANA00F;

  JOIN LOAD

  

ITSTAD AS C_PUNTO_VENDITA_TEMP,

   

AUTONUMBER (CDDTAD&'-'&CONTAD) AS CHIAVE_J;

SELECT * FROM CGANA03F

// FROM [..\QVD_EME\CGANA03F.QVD]   (qvd)

WHERE ITSTAD <> ' ' ;

 

DROP FIELD CHIAVE_J;

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

HI,

     The script i said will work only if you will fetch data from qvd.

     If you try to use the same for directly database it will not work.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

I beg your pardon ... but why it doesn't work on sql and it works on qvd?

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     Cause the script we wrote is specific to qlikview. The working of QlikView and Database is diff. Load statement is unknown for database.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

I tried your solution with the qvd as well and with autonumber (obviosly I had to use just the left joint .... but i think it's the same of left outer join)

The problem is ... is still doens't work ....

The sql query and load script give me two different results ....

Not applicable
Author

Yes indeed before I have used the load of a select ...

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     I would say if you can do the joining at database level, (meaning write sql with join to get the data.) do it there only. Cause QlikView might give you performance issue if the data is huge.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

iF i CANNOT GET THE SAME RESULT WITH THE QLIKVIEW SCRIPT AS WITH THE SQL QUERY I MUST FOLLOW YOUR ADVICE .

THANKS FOR YOUR HELP!