0

I'm working on convertion of sql from Teradata to snowflake, I've encoutered Normalize in sql with period(). Is there any equivalent in snowflake?

...
select  normalize
id,
abc,
xyz,
period(time,
case    
    when
mtnt = mtnt_bb_l
    and net_bb = net_bb_l
    and DATEDIFF(MONTH,time,lead(time,1) over (....))>1
then add_months (time +1,1)
    else lead(...)
end),
tms
from table
...

As you can see, normalize juste comme after select. is there any workround?

abdoulsn
  • 842
  • 2
  • 16
  • 32
  • 1
    No. You have to rewrite it using nested Analytic Functions. Search for "normalize overlapping periods" – dnoeth Oct 12 '22 at 09:07
  • Thanks that's I've discovered here https://docs.aws.amazon.com/prescriptive-guidance/latest/patterns/convert-the-teradata-normalize-temporal-feature-to-amazon-redshift-sql.html somehow same... I'm working on it. – abdoulsn Oct 12 '22 at 13:19

0 Answers0