Add week to any date and generate attribute
我有一个专栏
And One starting Date something like 01/01/2018.
I have to generate one new attribute "54_week" which will be my starting date(01/01/2018) + 54 week
And then make one new attribute "FLag" with condition IF(SVC_dt<=54_week,1,0)
And One starting Date something like 01/01/2018.
I have to generate one new attribute "54_week" which will be my starting date(01/01/2018) + 54 week
And then make one new attribute "FLag" with condition IF(SVC_dt<=54_week,1,0)
Tagged:
0
Best Answer
-
hbajpai MemberPosts:102UnicornHey@pallav,
You can generate a new attribute with date_add function that will add 54 weeks to the existing attribute. The flag attribute can be created easily by using date_before or date_after functions in generate attributes, you can use date_diff which is more precise and returns delta time in ms.
date_add(Col,54,DATE_UNIT_WEEK)
Best,
Harshit5