Would request your help with the below calculated field.
I am trying to add a concat function, which basically reflects it as 1 year or 2 year if the datediff is greater than 1 year and if the datediff is less than 1 year then reflect it as a 1 month, 2 months.
The ${YEARPARAMETER} is a rolling date
I am not sure where should I include the concat function to get the desired result
So, ${YEARPARAMETER} is a rolling date which always takes the previous day which in this case would be (1/7/2024).
My ifelse statement is basically trying to see if the (created date - rolling date ) looking for the year is greater than one then, I want to basically have the difference and add “years” using concat function. And if it is less than one year then the (created date - rolling date) looking for the month and add “month” using concat function.
I think my ifelse statement logic is wrong. Because while it does return me the datediff in months if the year >= 1, but using your concat(toString(“the difference as number”)," ",ifelse(diff>=1year,“year”,“month”)) what happens is if the returned month is also greater than 1 it returns it as 2 years. So for example if my created date was 11/10/2023, it should have returned 2 months, but rather it returns it as 2 years. Could you help me fix the logic. So that in the same ifelse statement I can get the year and at the same time the month if the year is less than 1.
But the logic itself is wrong, because although the ifelse statement fetch’s the MM for me if the datediff is less than 1 year. However, if the month is even 1 month, 2 months, the concat(toString(“the difference as number”)," ",ifelse(diff>=1year,“year”,“month”))'
still returns it as year. How can I correct the logic itself to return year if greater than 1 and month/s if less than 1 year