Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

In this article

Table of Contents
maxLevel2
absoluteUrltrue

Multiexcerpt include
templateData[]
MultiExcerptNameME_OE_ELT_Snap_Accounts
addpanelfalse
PageWithExcerptELT Aggregate

Overview

Use this Snap to add the SELECT DISTINCT SQL statement to the query coming from the upstream Snap. The SELECT DISTINCT SQL statement is used to fetch unique records from the table or eliminate duplicates in the output. This Snap also allows you to preview the result of the SELECT DISTINCT SQL statement on the incoming SQL query. You can validate the modified query using this preview functionality.


Note

You can use this Snap remove duplicates from the outputs of any ELT Snap such as ELT Select, ELT Intersect, and ELT Join. 

Prerequisites

None.

Limitation

Multiexcerpt include macro
nameME_ELT_GBQ_StandardSQL_UOI
pageELT Copy

Known Issues

Multiexcerpt include macro
nameME_ELT_KI_Underscore_Refs
pageELT Snap Pack

Snap Input and Output

Input/OutputType of ViewNumber of ViewsExamples of Upstream and Downstream SnapsDescription
Input 

Document

  • Min: 1
  • Max: 1
  • ELT Select
  • ELT Intersect
  • ELT Aggregate
The SQL query in which you want to add the SELECT DISTINCT statement. 
Output

Document

  • Min: 1
  • Max: 1
  • ELT Insert-Select
  • ELT Merge Into
The SELECT DISTINCT statement added to the incoming query. 

Snap Settings

Info
titleSQL Functions and Expressions for ELT

You can use the SQL Expressions and Functions supported for ELT to define your Snap or Account settings with the Expression symbol = enabled, where available. This list is common to all target CDWs supported. You can also use other expressions/functions that your target CDW supports.


Parameter NameData TypeDescriptionDefault ValueExample 
LabelString
Insert excerpt
File Writer
File Writer
nopaneltrue
ELT UniqueDistinct Records
Get preview dataCheck box
Multiexcerpt include macro
namegetpreviewdata
pageELT Intersect
Not selectedSelected

Troubleshooting

None.

Examples

Retrieving Distinct Values 

We need a SELECT DISTINCT query to retrieve distinct values from a table. This example shows how we can use a combination of the ELT Select and ELT Unique Snaps to accomplish this task.

 

First, we build a SELECT query to read the target table. To do so, we can use an ELT Select Snap. This Snap is configured to output a SELECT * query to read the target table in the database. Additionally, this Snap is also configured to show a preview of the SELECT query's execution:

Image Modified

A preview of the output from the ELT Select Snap is shown below:

Image Modified

Then, we add an ELT Unique Snap to the ELT Select Snap. Upon execution, the ELT Unique Snap adds the SELECT DISTINCT statement to the incoming query as shown:

We can also add an ELT Insert-Select Snap downstream and write the result of this query into another table.

Download this Pipeline.

Downloads

Note
titleImportant Steps to Successfully Reuse Pipelines
  1. Download and import the Pipeline into SnapLogic.
  2. Configure Snap accounts as applicable.
  3. Provide Pipeline parameters as applicable.

Attachments
patterns*.slp, *.zip


Insert excerpt
ELT Snap Pack
ELT Snap Pack
nopaneltrue


See Also

SnapLogic Product Glossary