---
title: "Source Sub-Accounts Relationship Data Block"
description: "*The Source Sub-Accounts Relationship Data Block (Source_SubAccountsRelationship) Data Block is a Source Data Block and is expected to be edited.* The Source Sub-Accounts Relationship Data Block (*Source_SubAccountsRelationship*) Data Block retrieves portfolio group associations from the `DEMO_DB` database. It returns the…"
url: "https://learn.assette.com/docs/source-sub-accounts-relationship-data-block/"
updated: "2024-11-28"
category: Developers / Data Blocks / Data Blocks by Category / Source Data Blocks
---

# Source Sub-Accounts Relationship Data Block

*The Source Sub-Accounts Relationship Data Block (Source_SubAccountsRelationship) Data Block is a Source Data Block and is expected to be edited.*

The Source Sub-Accounts Relationship Data Block (*Source_SubAccountsRelationship*) Data Block retrieves portfolio group associations from the `DEMO_DB` database. It returns the `MEMBERPORTFOLIOCODE` as `Code` and the `PortfolioCode` as `GroupAccountCode` based on a specified `AccountCode`. The Source Sub-Accounts Relationship Data Block (*Source_SubAccountsRelationship*) Data Block filters the data using the provided `AccountCode` and returns the associated portfolio details. This Data Block is expected to be edited.

## General Info

*The following table shows the default fields of the Data Block*.

| Field | Value |
| --- | --- |
| Name | *Source_SubAccountsRelationship* |
| Block Category | Interface |
| Block Type | Snowflake Database Call |
| Data Category | None |
| Output Type | Data Table |

## Dependencies

*The following table shows the default dependencies of the Data Block*.

| Data Block | Description |
| --- | --- |
| DEMO_SnowFlakeSettingBlock | The Demo Snowflake Setting (DEMO_SnowFlakeSettingBlock) Data Block is used to facilitate access the Assette Demo Snowflake Data Warehouse by providing values for ‘user’, ‘account’, ‘warehouse’, etc. This Data Block must be edited or removed as dictated by the client’s data needs. [[Link](https://learn.assette.com/docs/demo-snowflake-setting-data-block/)] |

## Columns

*The following columns are the default columns for the Data Object, all columns are optional unless marked otherwise. Please see footnotes for additional information.*

| Name | Data Type | Example | Description |
| --- | --- | --- | --- |
| CODE* | VCHAR[50] | ACCT123 | Unique account code |
| GROUPACCOUNTCODE* | VCHAR[50] | GRP3 | Unique group code |

* Indicates a mandatory column

## Example Definition

```
{
    "type": "table",
    "sql": "SELECT MEMBERPORTFOLIOCODE as "code", PortfolioCode as "groupaccountcode"  from DEMO_DB.DBO.PORTFOLIOGROUPASSOCIATION  where PORTFOLIOCODE=?",
    "parameters": ["AccountCode"]
}
```

## Example Request

*The following code shows an example request using the default values of the Data Block*.

```
{"AccountCode":"1120"}
```

## Example Response

*The following code shows an example response using the default values of the Data Block. The default data source is the Assette Snowflake Demo Instance. The response may be shortened for brevity*.
