# Holistics Datasets now are much more powerful without root model

**URL:** <https://community.holistics.io/t/holistics-datasets-now-are-much-more-powerful-without-root-model/244>\
**Category:** Product Releases\
**Created:** [October 11, 2019, 7:29am UTC](https://community.holistics.io/t/holistics-datasets-now-are-much-more-powerful-without-root-model/244 "2019-10-11T07:29:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Khai\_To](https://community.holistics.io/user_avatar/community.holistics.io/khai_to/32/128_2.png) [@Khai\_To](https://community.holistics.io/u/Khai_To)\
**Post date:** [October 11, 2019, 7:29am UTC](https://community.holistics.io/t/holistics-datasets-now-are-much-more-powerful-without-root-model/244/1 "2019-10-11T07:29:02Z")

</div>

Hello Holistics power users!

As you may know, we are rolling out a new version of Holistics that takes your analytical game to the next levels. The core components of the new Holistics experience, namely Data Models and Datasets, are constantly evolving, and today we would like to introduce to you a **new and more powerful version of our upcoming Dataset!**

# Drawbacks of the current version

## Dataset with _root model_ is not flexible enough

As shared previously, [Dataset](https://docs.holistics.io/docs/dataset) is a SQL generation interface that produces a series of JOINs according to the fields that you drag in. The current Dataset version requires a **root model** to act as the first table in the JOIN chain.

 ![](https://community.holistics.io/uploads/default/original/1X/1d54ba8655592450e98f005eff8ff82a1297e8db.png)  
 ![](https://community.holistics.io/uploads/default/original/1X/bc5755021379cb972b817a7423a561206424375f.png)

While this rigid structure allows Analysts to ensure data to be explored **exactly in the way they want** , it makes it **hard to reuse datasets.**

For example, we have models Orders, Users and Countries that have relationships with one another. To explore orders data using supplement information from the other two models, we need to create a dataset called **Orders - Full Info** with **orders** as root, while **users** and **countries** are peripherals.

 ![](https://community.holistics.io/uploads/default/original/1X/c8bba9fc55573f4cfaf6dfa64c4920c6bbc71fe7.png)

This dataset can answer questions like _“How many **orders** are from users at different countries?”_. Behind the scene, the generated queries will always have the following JOINs:

```
SELECT c.country_name, count(distinct o.user_id) as users_count
FROM orders o
LEFT JOIN users u on o.user_id = u.id
LEFT JOIN countries c on u.country_code = c.code
GROUP BY 1

```

In other words, it produces the list of users who **already purchased.** If the question is _“How many **registered users (both purchased and not purchased)**?”_ this dataset will not produce the correct answer. \*\*\*\*

To answer this new question you will need to create a **Users Info** dataset with **users** as root:

 ![](https://community.holistics.io/uploads/default/original/1X/6844495df148d86db47e764a88d06e4c54882321.png)

So the JOIN chain will be:

```
SELECT c.country_name, count(u.id) as users_count
FROM users u
LEFT JOIN countries c on u.country_code = c.code
GROUP BY 1

```

If there are multiple models that can be linked and explored in different ways, you may need to create multiple slightly different datasets, and it is **not an optimal way to reuse data.**

## Ambiguous path causes confusion

At the current version of Dataset, we allow **ambiguous paths between models** (Please check our [documentation](https://docs.holistics.io/docs/dataset#section-paths-between-models) for a detailed explanation). In a Dataset with the models and relationships below, there are multiple ways to go from `order_items` to `cities`:

 ![](https://community.holistics.io/uploads/default/original/1X/0626fb45623213b9d297e3b9350685ca5a83e49d.png)

 ![](https://community.holistics.io/uploads/default/original/1X/9d4fa92bdd4bcf7a1b2cd44ffa2cc13140ee41df.png)

While the concept of **JOIN**  **paths** is familiar for experienced SQL users, it is not friendly enough for the less technically inclined.

These two drawbacks pushed us to spend more efforts in researching and implementing a new version of Dataset that is **easy to use yet powerful** at the same time.

# Here comes the new Dataset:

![](https://community.holistics.io/uploads/default/original/1X/8cd1a5236d11e410df40f48361689f92f0c0d256.gif)

## No need for root model!

Just as the name suggested, you no longer need to specify a root model when creating a dataset. In other words, you only need **one dataset to rule them all!**

The same dataset with **Orders,**  **Users** and **Cities** can now answer both questions above:

- How many **orders** are from users in different countries?".

- How many **registered users (both purchased and not purchased)**?

Now you can reuse your Datasets efficiently.

## No ambiguous path

When we detect possible ambiguous paths between models, we will automatically disable a relationship that introduced the ambiguity. For example, if your models have the following setup:

 ![](https://community.holistics.io/uploads/default/original/1X/0626fb45623213b9d297e3b9350685ca5a83e49d.png)

We will disable the relationship between **Merchants** and **Cities** models:

 ![](https://community.holistics.io/uploads/default/original/1X/12fb5656a5e79b2ce4df6a97f367bc1ed6da3d19.png)

It is recommended that you duplicate **Cities** and **Countries** models into **dedicated models** for Users and Merchants. This makes your dataset clearer to the end-user:

 ![](https://community.holistics.io/uploads/default/original/1X/e18a7004d9ad477ea4c2d73d1748947f6c5d6d63.png)

# What will happen to my reports and Datasets and how to deal with errors if any?

All of your previous datasets will be automatically migrated to this new version. Your reports, however, may be affected by this change:

- Reports created from Datasets with **only one model** `will not be affected`
- Reports created from Datasets with multiple data models but only used fields in Root Model `will not be affected`
- Reports created from the Dataset but used **fields from peripheral models** `will be slightly affected` by the migration.

Behind the scene, those fields will be turned into “Legacy Fields” which cannot be edited or used in aggregations. To use the fields, you need to remove them from Viz Settings and drag them in again.

Your reports will still function normally if you do nothing, but we recommend you update your reports with the new fields.

 ![Screenshot_2](https://community.holistics.io/uploads/default/original/1X/de4a2df5f3e1fd067c39cb31eff4ecfbd9733907.png)  

[https://holistics-cdn.s3.ap-southeast-1.amazonaws.com/community/fix\_legacy\_fields.gif(image larger than 10 MB)](https://holistics-cdn.s3.ap-southeast-1.amazonaws.com/community/fix_legacy_fields.gif)

> In case you need help while migrating your works, please do not hesitate to contact us at [support@holistics.io](mailto:support@holistics.io). Happy modeling!

---

<div class="post-metadata">

**Author:** ![Khai\_To](https://community.holistics.io/user_avatar/community.holistics.io/khai_to/32/128_2.png) [@Khai\_To](https://community.holistics.io/u/Khai_To)\
**Post date:** [October 16, 2019, 8:51am UTC](https://community.holistics.io/t/holistics-datasets-now-are-much-more-powerful-without-root-model/244/2 "2019-10-16T08:51:34Z")

</div>

One small note is that even after removing legacy fields from Viz Settings and dragging them in again, you think that your report’s result is incorrect, it’s probably because we have automatically disabled some relationship directions that cause ambiguity in your Dataset.

In this situation, you could Click on Edit Dataset and adjust your Relationship Direction properly that matches your Business Logic.  
 ![](https://community.holistics.io/uploads/default/original/1X/3c0f66c05fa3f5025484c4e79ef34b4c421ac086.gif)  
In the example, after migrating my report, I perceived that it was indicating location-based metrics of my buyers instead of sellers. Thus, I disabled the direction from Users to Cities and enabled that from Merchants to Cities. And then voilà, my report was updated accordantly to the change

---

<div class="post-metadata">

**Author:** ![DataGeekDude](https://community.holistics.io/user_avatar/community.holistics.io/datageekdude/32/430_2.png) [@DataGeekDude](https://community.holistics.io/u/DataGeekDude)\
**Post date:** [June 14, 2022, 3:49pm UTC](https://community.holistics.io/t/holistics-datasets-now-are-much-more-powerful-without-root-model/244/3 "2022-06-14T15:49:23Z")

</div>

Thanks for this change, and I think this adds some great flexibility. When will this be available to all customers?

> [@Khai\_To](#):
>
> It is recommended that you duplicate **Cities** and **Countries** models into **dedicated models** for Users and Merchants

I agree that this concept is the way to solve a circular relationship but managing multiple model definitions isn’t great at all. I believe this is where `role-playing` tables is what we really need, so we can `alias` models with a prefix and have the same experience as you state, but with much much less maintenance overhead.

---

<div class="post-metadata">

**Author:** ![Khai\_To](https://community.holistics.io/user_avatar/community.holistics.io/khai_to/32/128_2.png) [@Khai\_To](https://community.holistics.io/u/Khai_To)\
**Post date:** [August 18, 2022, 4:21am UTC](https://community.holistics.io/t/holistics-datasets-now-are-much-more-powerful-without-root-model/244/4 "2022-08-18T04:21:03Z")

</div>

Hi Craig, this is something that we do have a plan to support but cannot share with you the exact timeline.  
I will link this thread to your original thread about Role-playing Models

> [@Role Playing Models / Model Aliases](https://community2.holistics.io/t/role-playing-models-model-aliases/754/8):
>
> We do have a plan to support it but for now I cannot share with you the exact timeline. I will definitely keep you in the loop for any update.
