cancel
Showing results for 
Search instead for 
Did you mean: 

Date functions in data federator

former_member185138
Participant
0 Kudos

Dear All,

We are using the MSU(multi source universe) which uses data federator functions.

Requirement is to create the following object

3 digits format (current month - 1).

So it should return 001 now as current month is Feb.

How we can achieve it here as ADD_MONTH function doesnt work here.

We could get it after applying below logic but how to format a date we are stuck.

CASE WHEN (month(curDate()))<=1 THEN concat('0',toString(month(curDate()) +11))

ELSE concat('0', toString(month(curDate())-1)) END

Regards,

SN

Accepted Solutions (1)

Accepted Solutions (1)

former_member185138
Participant
0 Kudos

Got it working by below formula:

case  when TOSTRING((MONTH(timestampAdd('SQL_TSI_MONTH', -1, now())))) <=9 THEN concat('00',TOSTRING((MONTH(timestampAdd('SQL_TSI_MONTH', -1, now()))))) ELSE concat('0',TOSTRING((MONTH(timestampAdd('SQL_TSI_MONTH', -6, now()))))) END

Does anyone have better approach

Answers (0)