Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
Very basic help needed.
How would I set up MTD & YTD in my script?
If my user selects a Month - it should give the MTD for that month and YTD up to and including the Month selected in the same table, etc
cal:
load *, month("Date") as Month, year("Date") as Year;
load date('1/07/2019' + recno() - 1) as "Date"
autogenerate '30/06/2020' - '1/07/2019';
It's hard to script å master calendar that supports all possible ytd mtd qtd wtd etc. So I would recommend you to start investigating how to do it in the expressions on top of a normal master calendar. The keyword here is SET analysis.
Take a look at this post for samples of ytd and mtd calculations: Date Level Analysis - WTD, MTD, QTD & YTD (Current Year & Previous Year)
Set analysis for ytd:
{<Date={">=$(=date#(yearstart(max(Date)),'MM/DD/YYYY'))<=$(=date(max(Date),'MM/DD/YYYY'))"}>}
Set analysis for mtd:
{<Date={">=$(=date#(monthstart(max(Date)),'MM/DD/YYYY'))<=$(=date(max(Date),'MM/DD/YYYY'))"}>}
Hi,
Can you attach your sample data set so it will give a clear idea.
Regards,
Shivani sapkale