Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to add current year and previous period to the filename
'$(vYear)'&P'max(Period)-1'&filename.qvd(qvd);
Can someone tell me if this is correct?
Thanks!
LET vYear=2015;
LOAD
Max(Period) as mPeriod
resident yourtable;
Let mPeriod = peek('mPeriod');
'$(vYear)'&P'$(mPeriod)-1'&filename.qvd(qvd);
should work
thank you!
I have a small correction here,
If month = jan ,period should be previous year's period i.e., 2014P12filename.qvd
other than jan period should be current year's previous period i.e., 2015P2filename.qvd through 2015P11filename.qvd
can u help me with this.
Thanks!
This should work:
table: // fake table, please use yours
LOAD AddMonths(today(),-RecNo()) as Period AutoGenerate 30;
tmp:
LOAD
Max(Period) as mPeriod
resident table;
Let mPeriod = num(month(AddMonths(peek('mPeriod'),-1)));
Let vYear = year(AddMonths(peek('mPeriod'),-1));
drop Table tmp;
store atable into [$(vYear)P$(mPeriod)filename.qvd](qvd);
No this is not working..
It gave me 1899P11Filename
Would you mind sharing a sample of your data?
The year problem is related to how your data is stored