4 Replies Latest reply on Apr 10, 2018 6:59 AM by sudheer.kumar.5

Calculated field: sales target YTM - full current month

Hello

I'm struggling to create a calculated field where it calculates the target YTM - that is: the target for the current year until the full current month. The YTD formula for the same is this:

IF [Date] < TODAY()-1

AND DATEDIFF('year',[Date],today()-1)=0

AND [Date] <= DATEADD('day',-1,today()-1)

THEN [Sales Target]

END

Do you have any ideas?

Best, Peter

• 1. Re: Calculated field: sales target YTM - full current month

Hi, Petur

Try this

IF [Date] < dateadd('month',1,datetrunc('month',Today())) and [Date] >= datetrunc('year', Today()) THEN

[Sales Target]

END

ZZ

1 of 1 people found this helpful
• 2. Re: Calculated field: sales target YTM - full current month

Brilliant - it works.

Thanks a lot!

/Peter

• 3. Re: Calculated field: sales target YTM - full current month

No worries, glad to help

ZZ

• 4. Re: Calculated field: sales target YTM - full current month

Hello Petur,

The below calculations will also give the expected result:

IF [Date] <= TODAY() AND YEAR([Date]) = YEAR(TODAY()) THEN [Sales] END

IF [Date] <= TODAY() AND DATEDIFF('year',[Date],today())=0 THEN [Sales] END

Regards,

Sudheer