10 Replies Latest reply: Feb 8, 2017 7:55 PM by Ali Ahmad

# how to create a MTD set analysis

Hi guys,

I have a data that have key in with future date and data. and i would like apply MTD for a KPI object.  This is my set analysis

Count({<Day=,Year=, Month=, Quarter=, Week=, Date=, DateNum={">=\$(=Num(MonthStart(Max({<Day>}DateNum))))<=\$(=Max({<Day>}DateNum))"}>} VISIT_KEY)

Now... after applying this, i dont understand why the MTD is 3 DEC 2017, that is the last record.

I would like to set the MTD, to calculate Month to Date, like now, is Feb 2017, suppose the MTD should be from 1 Feb til today 7 Feb.

How can i get that analysis with the above MTD set analysis?

Rgds

Jim

• ###### Re: how to create a MTD set analysis

May be use Today() instead of Max(DateNum)

Count({<Day=,Year=, Month=, Quarter=, Week=, Date=, DateNum={">=\$(=Num(MonthStart(Today())))<=\$(=Num(Today()))"}>} VISIT_KEY)

But what is the point of doing till 7th if you only have data until 3rd?

• ###### Re: how to create a MTD set analysis

Hi bro, i got 0 Value.. i click anything also 0 .

any missing bracket in ur set analysis???

• ###### Re: how to create a MTD set analysis

Doesn't seem like I missed any parenthesis.... not sure

• ###### Re: how to create a MTD set analysis

the data is until 3rd of DEC 2017... and the MTD is showing me this date's figure.

• ###### Re: how to create a MTD set analysis

MTD is showing you this date's figure? for Dec 3rd 2017?

• ###### Re: how to create a MTD set analysis

yeah. and i max(date) - it shows ing 3rd Dec.

• ###### Re: how to create a MTD set analysis

But I didnot even suggest you to use Max(Date).... I mentioned to use Today(). You cannot change to Today()?

• ###### Re: how to create a MTD set analysis

yes i did follow.  but shows me 0 value...nothing...

ount({<Day=,Year=, Month=, Quarter=, Week=, Date=, DateNum={">=\$(=Num(MonthStart(Today())))<=\$(=Num(Today()))"}>} VISIT_KEY)

• ###### Re: how to create a MTD set analysis

Can't say... may be someone else might know

• ###### Re: how to create a MTD set analysis

Why not create a current month flag instead?

 If(Month(Date) = Month(Today()), 1, 0) as [DateCurrentMonthFlag],

And use that in your set analysis?