Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys,
Why this not work?
[CFG_CARGA_INTEGRATION]:
LOAD
RowNo () AS ID,
CONNECTION,
CAMINHO,
EXECUCAO
FROM [lib://MI_csv/CONFIG_INTEGRACAO.xlsx]
(ooxml, embedded labels, table is EXTRACT)
WHERE UPPER(EXECUCAO) = 'S' AND NOT ISNULL(EXECUCAO);
Let v_Inicio = Num(Peek('ID', -1, 'CFG_CARGA_INTEGRATION'));
for a=1 to v_Inicio
Let vLib = FieldValue('CONNECTION',$(a));
Let vPath = FieldValue('CAMINHO',$(a));
CONCAT_TABLE_$(vPath):
let vCarga=Timestamp(Today(),'YYYYMMDD');
for a=0 to 2
let vCarga=Timestamp(Today()-$(a),'YYYYMMDD');
LOAD
Distinct
*
FROM [lib://MI_csv/Leituras/Individual_Read/RS_INDIVIDUAL_READ_$(vCarga).qvd](qvd) where DATE_READ>TODAY()-2;
next
exit script
May be
let vCarga=Timestamp(Today()-'$(a)','YYYYMMDD');
Hey Manish
My problem is in the Tables name -> CONCAT_TABLE_$(vPath):
I want to create 2 tables with the same script, for that i put it inside a loop.
But for some reason doesnt work
What are the contents (fields) for the
CONCAT_TABLE_$(vPath) table?
May be like this:
[CFG_CARGA_INTEGRATION]:
LOAD
RowNo () AS ID,
CONNECTION,
CAMINHO,
EXECUCAO
FROM [lib://MI_csv/CONFIG_INTEGRACAO.xlsx]
(ooxml, embedded labels, table is EXTRACT)
WHERE UPPER(EXECUCAO) = 'S' AND NOT ISNULL(EXECUCAO);
Let v_Inicio = Num(Peek('ID', -1, 'CFG_CARGA_INTEGRATION'));
for a=1 to v_Inicio
Let vLib = FieldValue('CONNECTION',$(a));
Let vPath = FieldValue('CAMINHO',$(a));
CONCAT_TABLE_$(vPath):
let vCarga=Timestamp(Today(),'YYYYMMDD');
for a=0 to 2
let vCarga=Timestamp(Today()-$(a),'YYYYMMDD');
CONCAT_TABLE_$(vPath):
LOAD
Distinct
*
FROM [lib://MI_csv/Leituras/Individual_Read/RS_INDIVIDUAL_READ_$(vCarga).qvd](qvd) where DATE_READ>TODAY()-2;
next
exit script
Hi Sunny mi friend,
doesnt work
Hi Manish,
Sorry, i dont understand. Contents (fields) ?
Did you mean this?:
LOAD
ID_SYSTEM,
CONCENTRATOR,
PORT,
DATE_READ,
VALUE_READ,
COD_ERRO,
ID_LEITURA
FROM [lib://Ultragaz QVD/RS_INDIVIDUAL_READ_20170224.qvd]
(qvd);
What he is trying to say is that you have a Table name, but where is the LOAD or SELECT underneath?
What is the use of declaring a table name and then going to a variable?
Ahhhh, now i understand.
I paste the code again, in a better vision. But the problem is, if i put only CONCAT_TABLE or CONCAT_TABLE_Ultragaz, it works fine and if i change Ultragaz to a variable vPath, occur that error messagem
for a=1 to v_Inicio
Let vLib = FieldValue('CONNECTION',$(a));
Let vPath = FieldValue('CAMINHO',$(a));
Let vCarga=Timestamp(Today(),'YYYYMMDD');
for a=0 to 2
let vCarga=Timestamp(Today()-$(a),'YYYYMMDD');
CONCAT_TABLE_$(vPath):
LOAD
Distinct
*
FROM [lib://MI_csv/Leituras/Individual_Read/RS_INDIVIDUAL_READ_$(vCarga).qvd](qvd) where DATE_READ>TODAY()-2;
next
Try Square Brakets around the table name:
[CONCAT_TABLE_$(vPath)]: