Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How to make a filter on Month in the load Script ?
Hi Experts,
In my data , i have four month , but i must make a filter in the load script to load only the month before the last (-1)
Example:
Month:
Load Script:
My Request: I wanna load only the Month before the last (-1) each time in the load script, so the Month 8 in this case
Tell me how to do to make a filter on the field Month
Thank you
Regards
Ali
So, essentially you don't want to load any data for the max month? Is this for only the current year or all the years?
LOAD * FROM .... WHERE MONTH(MyDate) = MONTH(TODAY() -1);
If you need a logic over the end of the year, you may convert the monthes into rolling monthes,
i.e.
LOAD * FROM .... WHERE YEAR(MyDate) * 12 + MONTH(MyDate) = YEAR(TODAY() * 12 + MONTH(TODAY() -1);
Hi Sunny,
is only for the current Year , and in my Data i have always 4 months , and i have to load only the month before the last (Max)
So in this case Max is 09 = September , i want to load only 08= August
Each time when i load the new Data , i want to have only the month (-1) before the last one (Max)
Hi Peter ,
is only for the current Year , and in my Data i have always 4 months , and i have to load only the month before the last (Max)
So in this case Max is 09 = September , i want to load only 08= August
Each time when i load the new Data , i want to have only the month (-1) before the last one (Max)
You need to create one variable to pick the Max Month value and then required to use Where condition using
Load * From Table Where Mois <= $(Variable)-1
loveisfail I think you are suggesting >= $(Variable)-1
Regards,
No, Because he need till last month data. If we give >=$(Variable)-1 it loads only Current and Last months data i believe..
Opps my mistake I'm suggesting = $(Variable)-1
because he wants only previous month data.
Regards,
Hi Anil,
Can you tell me All the steps to make the variable and where to put it in the Load
Thank You