Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all, I want to create a qvd generator but I'm facing some issues.
I have 2 sources, from which I've imported tables and changed them to create other tables I'll be using to generate qvds.
this is what I did:
SET ThousandSep=' ';
SET DecimalSep=',';
SET MoneyThousandSep=' ';
SET MoneyDecimalSep=',';
SET MoneyFormat='# ##0,00 €;-# ##0,00 €';
SET TimeFormat='hh:mm:ss';
SET DateFormat='DD/MM/YYYY';
SET TimestampFormat='DD/MM/YYYY hh:mm:ss[.fff]';
SET MonthNames='janv.;févr.;mars;avr.;mai;juin;juil.;août;sept.;oct.;nov.;déc.';
SET DayNames='lun.;mar.;mer.;jeu.;ven.;sam.;dim.';
//Connexion SQL
OLEDB CONNECT TO [Provider=SQLOLEDB.1;*********);
let date_Debut = date('01/01/2016','DD/MM/YYYY');
let date_Fin = date('31/01/2016','DD/MM/YYYY');
/////**************Chargement des données VLL Super *************/////////////
Ticket :
load *;
select
log_detail.prdcode as cod_ean,
log_header.log_audit as ID_transaction_VLL,
CONVERT (numeric, SUBSTRING(log_header.site_code,3,3)) as Code_Magasin,
......
from log_header,confsite,LOG_DETAIL,PRODUCT
where log_header.site_code = confsite.site_code
.....';
////////////***********Chargement EAN ************//////////////
OLEDB CONNECT TO [Provider=OraOLEDB.***;
Ean:
LOAD "EAN_CD" .....;
SQL SELECT *
FROM CENTRAL.MGEAN ;
Varianta_Activa:
LOAD
.....
FROM
(SELECT
B0.ARV_CDFO,
B0.ARV_NOART,
MAX(B0.ARV_DTDEB) AS DATA_DEBUT
FROM
CENTRAL.MGARV B0
WHERE
.....
;
//*************set the qvd folder path************
SET vQvdPath='D:\BMC OmarBenSalem\Documents OmarBenSalem\qvd generator\';
//************ list of tables************
List_Of_Tables:
LOAD * Inline[
tablename
Ticket
Ean
Varianta_Activa
];
//*******generate the loop for each value in the list of tables *************
FOR i=1 to FieldValueCount('tablename')
LET vTableName= FieldValue('tablename',$(i));
$(vTableName):
SELECT * from $(vTableName);
STORE $(vTableName) into [$(vQvdPath)\$(vTableName).qvd](qvd);
//*************qvd details info************
qvdDetails:
LOAD'$(vTableName).qvd' as QVD_NAME,
'$(vTableName)' as SOURCE_TABLENAME,
NoOfRows('$(vTableName)') as NO_OF_ROWS
AutoGenerate 1;
DROP Table $(vTableName);
NEXT i
-----------------------------------------
The problem is that each time I reload it seems to have a problem with this part:
"
//************ list of tables************
List_Of_Tables:
LOAD * Inline[
tablename
Ticket
Ean
Varianta_Activa
];"
as it keeps telling me that there is a FROM missing.
what should I do? what am I doing wrong?
Thank you all !
Make sure there's a space between the e and the [ character: LOAD * INLINE [
Unfortunately the missing space is not flagged as an error by QV11 script syntax checker, but that gap is plugged in QV12, See
Mind The Space | Qlikview Cookbook
-Rob
then what's wrong with my script? thank you
The problem is that each time I reload it seems to have a problem with this part:
"
//************ list of tables************
List_Of_Tables:
LOAD * Inline[
tablename
Ticket
Ean
Varianta_Activa
];"
The above INLINE is the problem and you need a space Inline & [
List_Of_Tables:
LOAD * Inline [
tablename
Ticket
Ean
Varianta_Activa
];
Okay, when I sepearted as you said btwn Inline & [ that went good.
But as I was expecting, for the QV, the Ticket object is an invalid object as the QV thinks of it as a table in the DB but It's not. It's a table that I've created with other tables imported from the DB.
What should I change to tell the QV that my tables are resident tables that I've created not tables to import directly from the DB?
(exp :
Ticket :
load *;
select
log_detail.prdcode as cod_ean,
log_header.log_audit as ID_transaction_VLL,
CONVERT (numeric, SUBSTRING(log_header.site_code,3,3)) as Code_Magasin,
......
from log_header,confsite,LOG_DETAIL,PRODUCT
where log_header.site_code = confsite.site_code
.....';)
That's the main question. thank you
I've come up with a solution and here it is:
//Store QVD
let i=0;
for i = 0 to NoOfTables()-1
Let vTableName=TableName(i);
STORE [$(vTableName)] into [..\1. Source\Delta\$(vTableName).qvd];
Next i;