Expressions for End Date of Historical Row field
In this article
Using a fixed (date or timestamp) value for the End date of Historical Row may lead the Snap to unexpected behaviors like incorrect data loads or Snap errors. Hence, we recommend that you enable the Expression button to and specify one of the following expressions:
Before using the expressions below, make sure that you consider the following:
# You can tailor the expression for Timestamp data type to match the sort column(s) and sort order mentioned in the ELT SCD2 Snap. Refer to the example expressions for the Date data type.
^ When start_date is not specified as the sort order column in the Snap configuration, the Snap automatically first sorts the rows in the ascending order of their start dates, followed by the other sort order columns specified. Hence, while you define the expression, you must include the start_date as the sort order column before mentioning the other sort order columns.
In case of timestamps, the above expressions consider adding 'n' hours. If your preference is different from this, you may tailor the respective expression to suit your needs.
Azure Synapse
Data Type of End date of Historical Row | Sort Column defined in Snap | Sort Order | Expression for End Date of Historical Row# |
---|---|---|---|
Date | START_DATE | Ascending |
|
Date | START_DATE | Descending |
|
Date^ | Any other | Any <SORT_ORDER> |
|
DateTime# | START_DATE | Ascending |
|
BigQuery
Data Type of End date of Historical Row | Sort Column defined in Snap | Sort Order | Expression for End Date of Historical Row# |
---|---|---|---|
Date | start_date, address | Ascending |
|
Date | start_date, address | Descending |
|
Date^ | Any other | Any <SORT_ORDER> |
|
Timestamp# | START_DATE | Ascending |
|
Databricks Lakehouse Platform (DLP)
Data Type of End date of Historical Row | Sort Column defined in Snap | Sort Order | Expression for End Date of Historical Row# |
---|---|---|---|
Date | START_DATE | Ascending |
|
Date | START_DATE | Descending |
|
Date^ | Any other | Any <SORT_ORDER> |
|
Timestamp# | START_DATE | Ascending |
|
Redshift
Data Type of End date of Historical Row | Sort Column defined in Snap | Sort Order | Expression for End Date of Historical Row# |
---|---|---|---|
Date | START_DATE | Ascending |
|
Date | START_DATE | Descending |
|
Date^ | Any other | Any <SORT_ORDER> |
|
DateTime# | START_DATE | Ascending |
|
Snowflake
Data Type of End date of Historical Row | Sort Column defined in Snap | Sort Order | Expression for End Date of Historical Row# |
---|---|---|---|
Date | START_DATE | Ascending |
|
Date | START_DATE | Descending |
|
Date^ | Any other | Any <SORT_ORDER> |
|
Timestamp# | START_DATE | Ascending |
|
Have feedback? Email documentation@snaplogic.com | Ask a question in the SnapLogic Community
© 2017-2025 SnapLogic, Inc.