Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
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
sunny_talwar

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];

View solution in original post

3 Replies
sunny_talwar

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];

sunny_talwar

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
Author

That works, thanks!