Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
we are working on a report which uses last 3 years of data. so we create variables in load script like our financial year from end of march
vyear=if(num(month(today()-1) ,'00')>3,right(num(year(today()-1),'00'),2),right(num(year(today()-1) ,'00'),2)-1);
vcurrentyear=$(vyear)&$(vyear)+1;
vpastyear=$(vyear)-1&$(vyear)
v2yearago=$(vyear)-2&$(vyear)-1
our data files are of format ->filename2223 which means file for financial year 22-23
we currently use some thing like this
load a,
b,
c
from filename$(vcurrentyear).qvd
concatenate
load a,
b,
c
from filename$(vpastyear).qvd so on can we use a for loop to optimise this
something like we only load once but have to concatenate when ever the loop ends
like
for var in list(vcurrentyear,vpastyear,v2yearago):
concatenate
load a,
b,
b
from filename$var;
Thank you
What about this approach that is only lookin at the first two digits of your year string.