Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm loading a csv file and part of the name of the file depends on a variable, its looks as it doesn't recognize the variable, I have tried the following and doesn't work, (the variable is vYearMonth)
1.
FROM
(txt, codepage is 1252, embedded labels, delimiter is ',', msq);
2.
FROM
(txt, codepage is 1252, embedded labels, delimiter is ',', msq);
Is there something that I'm missing?
Thanks & regards.
This works for me
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='gen;feb;mar;apr;mag;giu;lug;ago;set;ott;nov;dic';
SET DayNames='lun;mar;mer;gio;ven;sab;dom';
Directory;
SET vYearMonth=201302;
LOAD @1
FROM
[aaa_$(vYearMonth)_bbb.csv]
(txt, unicode, no labels, delimiter is '\t', msq);
SET vYearMonth=201303;
LOAD [03/01/2014 13:39:22: Execution started.]
FROM
(txt, unicode, embedded labels, delimiter is '\t', msq);
This works for me
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='gen;feb;mar;apr;mag;giu;lug;ago;set;ott;nov;dic';
SET DayNames='lun;mar;mer;gio;ven;sab;dom';
Directory;
SET vYearMonth=201302;
LOAD @1
FROM
[aaa_$(vYearMonth)_bbb.csv]
(txt, unicode, no labels, delimiter is '\t', msq);
SET vYearMonth=201303;
LOAD [03/01/2014 13:39:22: Execution started.]
FROM
(txt, unicode, embedded labels, delimiter is '\t', msq);
Dear Daniel,
Insert single quotes around your variable. this may work.
FROM
(txt, codepage is 1252, embedded labels, delimiter is ',', msq);
Regards,
Kiran Rode
+91 897 6977897
Hi,
I would do:
FROM
‘X:\source\CH_$(vYearMonth)_Report.csv’
Fabrice
Did you check whether vYearMonth gives the right output? Maybe you have to transform it e.g. with num() to get the right outcome.
Hi,
You are right, I didn't check the error correctly, the variable output was not what I wanted so it didn't find the file.
Thanks & regards.