SQL Query

DinMo allows you to create segments using an SQL query

To create a segment using an SQL query, follow these steps:

  • Select a Source - it will correspond to the DataWarehouse in which the query will be executed. Make sure the source has been added in the "Sources" tab before executing the query.

  • Enter your SQL query.

  • Click "Run query" on the upper right of the page. A preview of the result is then displayed on the right side of the page.

  • You might deselect properties if you wish to hide them in DinMo.

  • Once you are ready, hit "Continue".

  • In the next page, indicate the parent entity of the segment. Segments created using a SQL query need to be associated to a parent entity, and will only have the columns of the parent entity.

  • Give your segment a name, a description, and add tags if you want to facilitate the navigation.

  • Finally, indicate which column of the segment should correspond to the primary key column of the chosen parent entity. Based on this information, DinMo will only store in this segment the elements for which the primary key is as well present in the entity. In other words, the query you enter is translated into a query such as the following:

SELECT DISTINCT parent_entity.* 
FROM parent_entity INNER JOIN <User_QUERY>
ON parent_entity.primary_key = <User_QUERY>.primary_key

Last updated