6 Replies Latest reply on Feb 6, 2016 10:01 AM by kevin antony

# last month year should be minused

We have a display date calculated field ,it 's taking period column for the date.

and the period should be minused in the query if it falls on year end that is december

if CONTAINS([Time],"Weeks") then

str(datepart('month',datetrunc('week',[PERIOD],'Thursday')))+str("/")+str(datepart('day',datetrunc('week',[PERIOD],'Thursday')))+str("/")+str(right(str(datepart('year',datetrunc('year',[PERIOD],'Thursday'))),2))

end

in this I need to minus the period if it falls on December 31st ,How I need to do,Please update me on this.

• ###### 1. Re: last month year should be minused

attached workbook for refernce

• ###### 2. Re: last month year should be minused

attached workbook for reference

• ###### 3. Re: last month year should be minused

Kevin,

Shin

• ###### 4. Re: last month year should be minused

I have attached the package workbook for reference,

• ###### 5. Re: last month year should be minused

Kevin,

Thank you for sharing workbook.

I don't know the exact logic of your case's fiscal calendar, but to simply exclude 12/13/2015, I propose this method.

[Order _Date(Thu) +1]

DATETRUNC('week',([Order Date]),'Thursday')+1

[Order _Date(Thu) +1 / Year]

str(year([Order _Date(Thu) +1]))

You can filter out "2016".

Thanks,

Shin

• ###### 6. Re: last month year should be minused

In my query,i need to add two logic

1)normal logic

2)If its dec 31 2015 then i need to add the logic which you have provided.

I have added calculation 1 in calculated fied .aCan you add this additional query in that calculation 1

so that i will get an idea.Its urgent.

3)I m getting performance issue ,what I need to do