cancel
Showing results for 
Search instead for 
Did you mean: 

Script help to change time stamp and create days length categories

Jkovachi
Ranger

Good day, Incorta community.  I would really appreciate any help with my script.

  • Trying to update date from time stamp to date
  • Days difference to create length categories “1-7 days”, “8-14 days”, etc.”

Jkovachi_0-1648042864056.png

 

6 REPLIES 6

RADSr
Captain
Captain

Not sure you need the "format date" bit in there - can you just produce a formula column for days between? 

If you can do that you can wrap that formula in the case() function.

If not then something like CASE( daysbtween( (formatdate(blah)), (formatdate(blah2)) < 7 , '0-7 Days', 'More Days' )  

But really, start the troubleshoot by producing a days between column and making sure that bit works before adding more parens   ( parens are my nemisis 😉   ) 

 

-- IncortaOne@PMsquare.com --

Ty for sharing. 

dylanwan
Employee
Employee

If you have a column loaded from the source and the column is recognized as a timestamp column, you can go to the schema page and change the data type explicitly to "date" and load the data again.  

Screen Shot 2022-03-23 at 8.18.12 AM.pngScreen Shot 2022-03-23 at 8.18.28 AM.pngScreen Shot 2022-03-23 at 8.19.47 AM.png

It can also be set before you save the schema table after the extraction SQL was entered.  

If you want to keep the column with the timestamp data type and create another formula column that do not have the time component, the formula is removeTime(). 

Screen Shot 2022-03-23 at 8.27.39 AM.png

 

Ty, I don't have access to the schema.  I can only do at the insight level.