How to create a Single Stack object
  • 09 May 2023
  • 7 Minutes to read
  • Dark
    Light

How to create a Single Stack object

  • Dark
    Light

Article summary

The single stack object type enables users to join multiple objects into a single object, restrict or transform the object's output, and select columns and derived fields to publish in the resulting object. The single stack object type has many options, but this guide will cover the essential points for creating a new one.

1. From the Object Workshop home screen, click the plus sign icon in the upper right corner. 


2. In the Create New Object screen, select the Single Stack tile. 


3. Select the "+ | Base Object" button and then specify which object to pull data from in the SB Object dropdown. This is analogous to the FROM clause in SQL. Note SB stands for Stack Base. 


Once the object has been selected, the following three panels, specific to the stack base object, are presented:

  • Settings 
  • Derived Fields, Restrictions, and Transformations 
  • Available Fields


4. Select which fields to publish from the Available Fields panel.

The Available Fields panel is analogous to the SELECT clause in SQL. To include a field from the stack base object in the output of the object being created, select the checkbox to the left of the field name.

Once a field is selected, the Field Name, Column Name, and Field Group columns will display the values inherited from the stack base object. These values can be overwritten as needed, but it is uncommon to need to change the default values. 

There are a few features in this panel worth clarifying. 

  • Inherit Field Settings from Base Object: Selecting this checkbox will select all fields and their settings from the stack base object. Any changes to the fields or their settings made in the stack base object will automatically be inherited in the object being created. 
  • Prepend Text to Default Field Names: Any text added in this field will be prepended to the beginning of all field names. 
  • Analytic: Selecting this checkbox ensures potential splits are cached when the object being created is used in a measure. This functionality is typically used for categorical fields with relatively few values.


5. If needed, create derived fields in the Derived Fields, Restrictions, and Transformations panel. 

Derived fields are fields defined by the data in other fields and are analogous to selecting a column that does not existing in the underlying table(s) in SQL. For example, using the Case When derived field pattern is analogous to selecting a Case expression in SQL, e.g., SELECT CASE WHEN field1 = NULL THEN 0 ELSE 1 END.

To add a derived field, select the Add Derived Field button, an then select the appropriate derived field pattern for accomplishing the desired transformation. After selecting a pattern, update the its parameters, and then click the Done button.


6. If needed, apply restrictions in the Derived Fields, Restrictions, and Transformations panel. 

Restrictions enable users to filter the rows in an object to only those meeting certain criteria. Restrictions are analogous to the WHERE clause in SQL. Restrictions can be added following the same guidance that was provided for derived fields.


7. If needed, link a new object to the stack.

Select the "+ | Linked Object" button and then specify the object to be linked from the Select SL1 Object dropdown. This is analogous to using a JOIN clause in SQL. Users will have the option to specify the type of join after selecting the object. Note SL1 stands for Stack Link 1.

Once an object has been selected, the following four panels, specific to the linked object, will be presented

  • Settings 
  • Derived Fields, Restrictions, and Transformations
  • Upstack Restrictions
  • Available Fields

In the Upstack Restrictions panel, choose one of the following options from the Enforce Linked Object Existence dropdown:

  • Instance(s) of Linked Object Must Exist: This option is analogous to a INNER JOIN.
  • Instance(s) of Linked Object May Exist: This option is analogous to a LEFT OUTER JOIN.
  • No Instance(s) of Linked Object May Exist: This option is analogous an exclusionary LEFT OUTER JOIN, e.g., SELECT <select_list> FROM tbl1 LEFT OUTER JOIN tbl2 ON tbl1.key = tbl2.key WHERE tbl1.key IS NULL.

Next, select the Add Restriction button and choose the Foreign Key pattern from the dropdown. This is analogous to the ON component of the join. Update the Foreign Key pattern's parameters and then select done.


8. Click on the bar that reads “Single Stack” above the stack base object and select the Naming panel. In the Naming panel, update the following fields: 

  • Object Namespace: Select the namespace to be associated with the object being created. Depending on which data model layer the object will be assigned to, the namespace can represent different things. For objects assigned to the source data, semantic mapping, metadata and integration, and local transform layers of the data model, i.e., object associated with the integration of data, the namespace contains a description of the data’s source, e.g., CMS, Humana; etc. For objects assigned to the natural object, synthetic object, and data mart layers of the data model, i.e., object associated with reporting and analysis, the namespace contains two parts. The first part describes who developed and manages the object, and the second part describes the object’s conceptual domain. For example, the namespace, URSA-CKD, indicated that Ursa Health is the owner of the object, and that it pertains to chronic kidney disease (CKD).
  • Object Name: Enter a descriptive name for the object.
  • Object Description: Enter a description of the object being created. The convention used by the Ursa Health team is to describe the grainsize of object, e.g., “One row per pharmacy claim.” However, it is common for object descriptions to contain more than this minimum information.
  • Database Object Type: Select whether the object should generate a table or a view in the database.
  • Table (or View) Name: Enter a table or view name for the object. The Ursa Health team uses a convention that typically includes four parts, [layer]+[namespace]+[object description]+[#], e.g., so_ursa_core_enc_001.
    • A token is used to indicate the layer the object is associated with, e.g., if the object exists at the synthetic object layer of the data model, the token "so" is used.
    • The object’s namespace is included.
    • A token describing the object’s contents, e.g., if the object contains encounters, the token “enc” is used.
    • A number is appended to the end of the table name to distinguish it from other like-named tables, e.g., there are several objects with table names that begin "so_ursa_core_enc." The appended number makes the table name unique.
  • Tags: Select or enter any tags that should be associated with the object. Tags are general purpose labels that can be applied to a variety of data assets in Ursa Studio for identification and categorization.


9. In the Object Metadata panel, update the following fields: 

  • Layer: Select the data model layer the object will be associated with.
  • Is Dedicated Precursor: This option allows users to specify if the object is a dedicated precursor to a terminal object. This functionality is used to reduce the object’s visibility to other objects it is not a dedicated precursor to.
  • Is Visible to Layers / Use Layer Default: This option allows users to set which data model layers the object will be visible to. Unless there is a specific reason for altering the default visibility, which is uncommon, users should leave the default layers selected.
  • Temporal Class: Select the appropriate, temporal class for the object. Temporal class is a categorical description of an object’s relationship to time as an event, interval, or entity. If a table’s records represent a moment in time, e.g., claims, then select event. If a table’s records represent a period of time with a start and end date, e.g., episodes, then select interval. If a table’s records do not represent a moment in time or a period of time, e.g., health plans, then select entity.
  • Case ID: Select the field or fields that uniquely identify each record in the table.
  • Use Case Field for Primary Key: Select this option to use the previously identified case field as the primary key. Typically, this option is selected.
  • Patient ID: If the table contains a field that identifies patients or members, select that field here.


10. Finally, to create the object, scroll up and select the lightning bolt icon in the upper right corner of the screen. When selected, the screen is redirected back to the Object Workshop home screen, and the object will be run. When the object’s run has finished, reopen the object, and select the data review icon in the upper right corner of the screen to review the object’s data.


This article only covers a subset of the features available in Single Stack objects. For more information on Single Stack objects, please see the Ursa Studio Product Manual.


Was this article helpful?