Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey people,
I need some help, i think will be a silly question cause its very simple to workaround, but i want to learn so i have this 2 codes:
LET vDataCarga_ini=date(today(), 'YYYYMM');
LOAD
*
FROM
[lib://MI_csv/CONSUMO_ELEVADO_DIARIO_$(vDataCarga_ini).qvd](qvd)
WHERE $(vDataCarga_ini)??>(TODAY()-5);
************
CONCAT_TABLE:
LOAD
*
FROM [lib://MI_csv/RS_INDIVIDUAL_READ_*.qvd]
(qvd) where DATE_READ>TODAY()-2;
If i chance code two to
FROM [lib://MI_csv/RS_INDIVIDUAL_READ_??.qvd]
It works fine
So, why i can't do this in code one?
[lib://MI_csv/CONSUMO_ELEVADO_DIARIO_$(vDataCarga_ini)??.qvd](qvd)
This should work, I think
[lib://MI_csv/RS_INDIVIDUAL_READ_$(vDataCarga_ini)??.qvd](qvd)
How does the qvd filename look like? Can you share one of the names?
Off Course
I make a qvd daily, so i have:
RS_INDIVIDUAL_READ_20170101.qvd
RS_INDIVIDUAL_READ_20170102.qvd
RS_INDIVIDUAL_READ_20170103.qvd
RS_INDIVIDUAL_READ_20170104.qvd
RS_INDIVIDUAL_READ_20170105.qvd
and goes
These are different qvd then this
[lib://MI_csv/CONSUMO_ELEVADO_DIARIO_$(vDataCarga_ini)??.qvd](qvd)
This should work, I think
[lib://MI_csv/RS_INDIVIDUAL_READ_$(vDataCarga_ini)??.qvd](qvd)
Humm i found the problem, your code works very good but its in WHERE clause that thing goes wrong.
First problem, i need to change WHERE $(vDataCarga_ini)??>(TODAY()-5); to WHERE $(vDataCarga_ini)&'??'>(TODAY()-5);
and second I cant use a variable to filter, cause it doesn't part of the tables, for that reason i get no data.
Thank you Sunny
May be this:
Where Date#(SubField(FileBaseName(), '_', -1), 'YYYYMMDD') > Today() - 5;
Wow, It works too !
the only strange thing, its when i try order by, not work
LOAD
*
FROM
[lib://MI_csv/CONSUMO_ELEVADO_DIARIO_$(vDataCarga_ini)??.qvd](qvd)
Where Date#(SubField(FileBaseName(), '_', -1), 'YYYYMMDD') > Today() - 5
ORDER BY DATA_DEFEITO;
You cannot use Order by in a qvd, Excel or any other type of file load..... It only works when you do it on a Resident load
Also look here:Load ‒ QlikView