Skip to content
Advertisement

Tag: amazon-redshift

Group By based on consequtive flag in Redshift (Gaps and Islands problem)

I am trying to solve “gaps and islands” and group consecutive checks together. My data looks like this I want to group by consecutive location_id and consecutive reservation_id (both should be consecutive respectively) within same date and site_id, and sum revenue. so for the example above the output should be: Location_id and reservation_id are of no importance except for this

How to add date to a file’s name using UNLOAD in Redshift

I found 2 solutions: Using AWS Data Pipeline to schedule the query (Unload) and use ‘s3://reporting-team-bucket/importfiles/test_123-#{format(@scheduledStartTime,’YYYY-MM-dd-HH’)}.csv’ writing an MV command to rename the file on the s3 bucket Is there a way to give a file’s the current date by only using Redshift, with no other services? Here is my code so far: Just need to get CurrentDate to be

Advertisement