top of page

Ragged Hierarchy Function in Sigma

7 hours ago
3 min read

Do you want to be able to drill down or drill up in a data source? In Sigma you can do this with the Ragged Hierarchy function! What is Sigma? Its an AI application on a BI platform!


If you want to follow along with this tip, please visit https://public.sigmacomputing.com/ and create an account! It's free!


To start, click on the Create an App button in the upper right hand corner of the screen.




Give your app an name in the Title field and enter a brief description in the Description field.

Next, select a Category for your workbook.

Then click the Save Details button.

Click on the Data button on the next window.



Then select Table.


Click on the Join button.



Go to the Data sources tab on the Select source pop-up menu.

Click on Connections and then click the Sample Database. Sigma has a robust sample of multiple data sources in this database!


On the Select source pop-up menu, go to FINANCE, click on PLUGS_ELECTRONICS_FINANCIALS and then click on the ACTUALS table.



In the next preview screen uncheck the box for Journal Entry Id and then click on the Select button.



You will be directed to a Create join preview screen. Here you will need to click on the plus sign in the Sources menu to add another data source.



Go to your Sample Database and search for Account. Select the ACCOUNT_HIERARCHY table



Uncheck the boxes for Level 1 Code and Level 2 Code.

Then click on the blue Select button in the lower right-hand side of this pop-up menu.


In the next Create join menu you will see that Sigma found the Primary Key of Account for both data sources. Make sure Left outer join is selected for the Join type drop-down.



Click on the Preview output button.

In the next screen you can see data from both tables. Here you can uncheck any other columns to remove them.

Click on the Done button in the upper right-hand corner.

Rename your joined data source to ACTUALS | Hierarchy

Click on the down arrow on the Level 2 Category column.

Select Add a new column.




Sigma will place your cursor in the fx formula bar in the top of the screen.

Type in "Ragged" and select Ragged Hierarchy from the drop-down.


Here you will need to hold the ctrl key down and select the Section column. Let go of the ctrl button and type a ,

Hold the ctrl key down again to click on Level 1 Category column and type a , after it. Do the same steps for Level 2 Category column and the Description column.


OR


You can paste the below field in the function menu:

RaggedHierarchy([Section],[Level 1 Category],[Level 2 Category],[Description])


Sigma will skip over any nulls and pull in the next column in this function. Here is the Sigma document link if you want to learn more about this function! Sigma will also rename the column New Hierarchy. You can rename this if you wish.



I clicked on the bar chart icon on the pop-up menu for this table element. I clicked on Pivot table.




With the New Pivot table selected, I dragged the New Hierarchy the previous steps created to PIVOT ROWS in the Editor Pane that appears on the right hand side.

I then dragged Amount to VALUES

It created this nice pivot table of the data that I can drill down into or drill up!





Subscribe to Tips

If you find my tips useful, please subscribe.

Thanks for submitting!

  • Linkedin

© 2023 by BrainStorm. Proudly created with Wix.com

bottom of page