Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I want to write a loop that will look through two columns of a static table and create all month / year combinations
I then want to use it in this situation in a straight table for searching for a string in a field and creating the date in MM/YYYY format instead of having to write a hundred lines for all different month / year combinations. Can this be done in the load script?
Thanks in advance!
Maybe like
INPUT:
LOAD * INLINE [
Month, Year
Jan, 2016
Feb, 2017
Mar, 2018
Apr, 2019
May, 2020
Jun, 2021
Jul, 2022
Aug,2023
Sep,2024
Oct, 2025
Nov,2026
Dec,2027
];
TMP:
LOAD Month Resident INPUT;
JOIN
LOAD Year RESIDENT INPUT;
RESULT:
LOAD Date#(Month&Year,'MMMYYYY') as YearMonthDate,
Month,
Year
RESIDENT TMP;
DROP TABLE TMP, INPUT;
Haven't understood where and why you want to use the if() statement, though, isn't YearMonthDate what you are looking for?
[And please try to post tables in text formats, not using screenshots]
Regards,
Stefan