3 Replies Latest reply on Mar 23, 2016 7:04 PM by Shivang Desai

# subtract 1 from string "2015/16" to get "2014/15"

Hi All,

I am doing a calculation where I need to subtract 1 from string "2015/16"  which belongs to [Date Financial Year] dimension and I should get "2014/15"

I tried this logic:

str(int([Date Financial Year]) - 1)

but my result is null.

Can anyone tell me how can I subtract so that I get the result "2014/15"  ?

Kind Regards,

Shivang Desai

• ###### 1. Re: subtract 1 from string "2015/16" to get "2014/15"

Try this

Str(year (Financial Year)-1)+"/"+STR(day(Financial Year)-1)

• ###### 2. Re: subtract 1 from string "2015/16" to get "2014/15"

Hi Venkatesh,

Thanks for the reply but Financial Year is a string and not a date, so the above formula doesn't work.

Ex: "2014/15", "2016/17"

Regards

• ###### 3. Re: subtract 1 from string "2015/16" to get "2014/15"

I found a solution :

STR(INT(LEFT((Date Financial Year),4))-1)+"/"+TR(INT(RIGHT((Date Financial Year),2))-1)