Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi community,
We have a data origin (.xlsx) that habitually contains 24 columns, one for each hour. But in the days when daylight saving time starts and ends (like 2019-10-27) this .xlsx has 23 or 25 columns, and the app data load fail.
Currently, we must watch out this days to change app script and return to standard script the next day.
We're looking for a way to not to be alert those days. We know we can control script execution with IF-THEN-ELSE statements, but we don't know how (if it's possible) we can identify if today is a 23 or 25-hours day.
There's a function or simple code to know if today is a 23 or 25-hours day?
We're trying to do some as:
IF (today_is_23-hours_day) THEN
read and process a 23-hours_day .xlsx
ELSE IF (today_is_25-hours_day) THEN
read and process a 25-hours_day .xlsx
ELSE
read and process a standard 24-hours_day .xlsx
END IF
Thanks in advance,
Luján Torres.
for 23 hours day:
if month(today())='Mar' and day(today()) >= 25 and weekday(today()) = 'Su.' then
load 23 columns
elseif
if month(today())='Oct' and day(today()) >= 25 and weekday(today()) = 'Su.' then
load 25 columns
else
load 24 columns
endif
(edit your results on your regional settings)
Another possibility:
if the data makes it possible load *. This also works with crosstable
Regards
for 23 hours day:
if month(today())='Mar' and day(today()) >= 25 and weekday(today()) = 'Su.' then
load 23 columns
elseif
if month(today())='Oct' and day(today()) >= 25 and weekday(today()) = 'Su.' then
load 25 columns
else
load 24 columns
endif
(edit your results on your regional settings)
Another possibility:
if the data makes it possible load *. This also works with crosstable
Regards
Thanks Martin for such quick reply!
Your proposal is both smart and simply!
We can't use LOAD * because data origin and process is more complex than I've showed before.
Thanks again!