Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Having never done this before I will keep it short and sweet.
I have needed to do this a few times building different models so thought I would share it in case someone else can benfit or better yet someone with more product knowledge suggest a better technique.
With this bit of script I am hijacking the INLINE LOAD to force some values in to a table. In this example I am loading the last three years to later use in another table load as a "WHERE exists(..."
LET i = nothing;
LET CONCATENATE = nothing;
LET CONCATENATE = '';
FOR i = 0 to 2
if i > 0 then
LET CONCATENATE = 'CONCATENATE';
endif
$(CONCATENATE)
FilterYears:
LOAD
right(year(now(1))-$(i),2) as [Order Header Order Date Year]
INLINE
[
Order Header Order Date Year
1
]
;
NEXT i;
LET i = nothing;
LET CONCATENATE = nothing;
Cheers
Oli
You can do it without a for next loop and all those variables:
LOAD right(year(now(1))-RecNo()-1,2) as [Order Header Order Date Year] AutoGenerate 3;
now THAT'S a lot simpler!!
I always forget about autogenerate as the only place I use it is in a calendar script which I copy paste from script to script.
Thanks