Using <CurrentDate> in calculations

More
2 years 4 months ago #23604 by prashant
Hellos,
I am trying to use the <currentdate> in calculations (inside package) but failing. If I plugin it directly inside dayofweek(<currentdate>) I get interpreter error 
Code:
begin   if DayOfWeek(EncodeDate(2024, 4, 16)) = 2 then     Result := True   else     Result := False; end.

Please Log in or Create an account to join the conversation.

More
2 years 4 months ago #23605 by admin
<CurrentDate> is a string so it has to be converted to TDateTime

This one works

begin
  if DayOfWeek(FormatStrToDate(GetVariable('<CurrentDate>'),'YYYY-MM-DD')) = 2 then
    Result := True
  else
    Result := False;
end;

this one also works

begin
  if DayOfWeek(Now()) = 2 then
    Result := True
  else
    Result := False;
end;

Or you can just use Check Date Package Action

www.etl-tools.com/wiki/advanced-etl-proc...s/check-date-action/

Mike
ETL Architect

Please Log in or Create an account to join the conversation.

More
2 years 4 months ago #23606 by prashant

Or you can just use Check Date Package Action

www.etl-tools.com/wiki/advanced-etl-proc...s/check-date-action/

I completely missed this !!! THANK YOU . Can I request for a checkbox here , instead of Radio Button so multiple days can be selected ??
-
Code:
if DayOfWeek(FormatStrToDate(GetVariable('<CurrentDate>'),'YYYY-MM-DD')) = 2 then
Thanks for this ! I could have never figured this on my own . Can I assume all ETL variables in calculation are to be encoded with GetVariable('<___>') 
 
The following user(s) said Thank You: admin

Please Log in or Create an account to join the conversation.

More
2 years 4 months ago #23607 by admin
>>>Can I request for a checkbox here , instead of Radio Button so multiple days can be selected ??

That is a good suggestion, we will add it to the development plan

>>> Can I assume all ETL variables in calculation are to be encoded with GetVariable('<___>') 

That is correct

Mike
ETL Architect
The following user(s) said Thank You: prashant

Please Log in or Create an account to join the conversation.

More
2 years 4 months ago - 2 years 4 months ago #23704 by admin

Can I request for a checkbox here , instead of Radio Button so multiple days can be selected

FYI This was implemented in the latest release.

 

Mike
ETL Architect
Last edit: 2 years 4 months ago by admin.
The following user(s) said Thank You: prashant

Please Log in or Create an account to join the conversation.

Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Read more
Marketing
Set of techniques which have for object the commercial strategy and in particular the market study.
Google
Accept
Decline
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Google Analytics
Accept
Decline
Functional
Tools used to give you more features when navigating on the website, this can include social sharing.
Advertisement
If you accept, the ads on the page will be adapted to your preferences.
Google Ad
Accept
Decline
Save