Vedachalam Mahadevan
03/13/2025, 7:34 AMCeligo AI
03/13/2025, 7:34 AMAI generated answer (using internal Slack threads):The issue with the expression
<#assign endDate = (.now?long + 31536000000)?number_to_date?string("yyyy/MM/dd")>
not giving the next year seems to be related to the way the date is being calculated. The expression is adding 31536000000 milliseconds (equivalent to 1 year) to the current date and then converting it to a date format. However, this might not always result in the next year's date due to the way leap years are handled.
In the first thread, the user is trying to calculate an end date based on a lead time. The error they're encountering is due to incorrect syntax in their CASE statement. The correct syntax was provided by another user: CASE WHEN {custbody_leadtime} = '2-4 Weeks' THEN {trandate} + 28 WHEN {custbody_leadtime} = '4-6 Weeks' THEN {trandate} + 42 ... END
.
In the second thread, the user is trying to calculate the difference between two dates. The suggested solution is to subtract the start date from the end date using the TO_DATE function: ABS(TO_DATE({endate})-TO_DATE({startdate}))
.
In the third thread, the user is trying to determine if a record is "old" based on the last sale date. The suggested solution is to compare the last sale date to a specific date: {lastsaledate}>(TO_DATE('2017-12-31', 'YYYY-MM-DD'))
.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
03/13/2025, 7:34 AMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.802541792
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.802108049
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.800436378
Celigo AI
03/13/2025, 7:34 AM