Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Problem with dates in selections for script

Good afternoon,

any suggestions why below scripts fails with message "Garbage after statement"?

Thanks!

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='Jan;Feb;Mrz;Apr;Mai;Jun;Jul;Aug;Sep;Okt;Nov;Dez';
SET DayNames='Mo;Di;Mi;Do;Fr;Sa;So';


set DayForSelection = 23.05.2016;


Directory;
LOAD
Personalnr as Personalnummer,
// [Gültig bis],
// [Gültig ab],
   [ID/Nummer] as UserID
FROM
PA0105.xls
(
txt, unicode, embedded labels, delimiter is '\t', msq, header is 3 lines, no eof) where [Gültig ab] < $(DayForSelection)  and  $(DayForSelection) <=  [Gültig bis];

1 Solution

Accepted Solutions

Re: Problem with dates in selections for script

Can you try this:

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='Jan;Feb;Mrz;Apr;Mai;Jun;Jul;Aug;Sep;Okt;Nov;Dez';
SET DayNames='Mo;Di;Mi;Do;Fr;Sa;So';


SET DayForSelection = 23.05.2016;


Directory;
LOAD
Personalnr as Personalnummer,
// [Gültig bis],
// [Gültig ab],
  [ID/Nummer] as UserID
FROM
PA0105.xls
(txt, unicode, embedded labels, delimiter is '\t', msq, header is 3 lines, no eof) where [Gültig ab] < '$(DayForSelection)'   and  '$(DayForSelection)' <=  [Gültig bis];

3 Replies

Re: Problem with dates in selections for script

Can you try this:

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='Jan;Feb;Mrz;Apr;Mai;Jun;Jul;Aug;Sep;Okt;Nov;Dez';
SET DayNames='Mo;Di;Mi;Do;Fr;Sa;So';


SET DayForSelection = 23.05.2016;


Directory;
LOAD
Personalnr as Personalnummer,
// [Gültig bis],
// [Gültig ab],
  [ID/Nummer] as UserID
FROM
PA0105.xls
(txt, unicode, embedded labels, delimiter is '\t', msq, header is 3 lines, no eof) where [Gültig ab] < '$(DayForSelection)'   and  '$(DayForSelection)' <=  [Gültig bis];

Re: Problem with dates in selections for script

Or may be this:

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='Jan;Feb;Mrz;Apr;Mai;Jun;Jul;Aug;Sep;Okt;Nov;Dez';
SET DayNames='Mo;Di;Mi;Do;Fr;Sa;So';

SET DayForSelection = Num(MakeDate(2016, 5, 23));


Directory;
LOAD
Personalnr as Personalnummer,
// [Gültig bis],
// [Gültig ab],
  [ID/Nummer] as UserID
FROM
PA0105.xls
(txt, unicode, embedded labels, delimiter is '\t', msq, header is 3 lines, no eof) where [Gültig ab] < $(DayForSelection)  and  $(DayForSelection) <=  [Gültig bis];

Not applicable

Re: Problem with dates in selections for script

That works, thanks!

Community Browser