How To Format A Matrix
- Overview
- Transcript
This video teaches you how to take an existing matrix and format it. It covers styling each matrix space (data, column headers, row headers), controlling row indentation to show account hierarchy, pinning rows/columns so headers stay visible while scrolling, and writing conditional format rules keyed off a row or column's dimension index and hierarchy level.
Facts to Remember
- A matrix has separate style sections for data, column headers, row headers, and corner headers.
- Format rules are the way to highlight specific rows or columns (e.g. darker shading for higher-level parents, no background for leaf-level accounts).
Hello everyone, my name is Rahim here at the product team at Una AI.
Today I'm going to be walking you through how to format a matrix and design it the way that you want for it to be seen.
So let's get started.
So in front of me here, I have a matrix for an income statement.
So why don't we right click here, click edit.
So let's say I wanted to give my matrix a bit of a formatting.
It's not as organized as I want it to be.
I want it to give more visuals.
Maybe I want to bold some columns.
Maybe I want to give it a background color.
I want to do some things.
So let's get started.
So under this base section here, you'll see we have many sections.
We have data, we have column headers, we have row headers, corner headers.
And as you can assume, every single section is going to format that with respect to it.
Let's say we want to give our columns some background color and we want to give it, we want to bold it a little bit for it to be a bit more visible.
So we're going to go under column headers section.
We're going to click on background color.
Let's say we want to give it a grayish vibe.
We're going to go with gray.
And then the font weight, let's say we want to give it about 500, make it a bit bold.
And as you will see on our left side, it will likely update and it will bold and give our column headers a background.
Perfect.
Let's say I want to do the same thing with rows.
Again, I will go down to row headers.
I will click background color, give it gray, font weight.
Let's go with the same thing, 500.
And we'll see that this section here will get folded and have a background color.
Perfect.
Now, let's say that we want to be able to mess around with the hierarchy and formatting of our accounts.
Right.
So, um, if you can, you can, as you can see, if I put indent type to none, what we'll see is this whole column will become flat.
So revenues on the same level as gross product sales, it's just a flat list of our accounts, right?
Now let's say I wanted to be able to see my parent accounts.
Like obviously revenue would be a total of such accounts.
Like gross product sales, net product sales.
And I wanted obviously the children like net product sales, gross product sales, discounts and promotions, returns and allowances to be a bit more indented.
So I can see my totals better.
So what I'm going to do is go on row headers as this is the row section.
I'm going to click on indent type and change it to absolute.
And what absolute is going to do is it's going to be able for us to see our parents.
So we can see here we have the revenue parent and the children of it is these accounts.
So this makes for us to be able to see these total parent accounts much more easier and much more visible.
So as we can see, if I scroll all the way down, net income will be much more less than everything else as everything else is a parent to it, a child to it, sorry.
Right, so we have that.
Okay, perfect.
So here we have our data section.
So let's say I wanted to be able to really give my numeric values a bit of formatting.
So let's say we were working with We could give our style for under data, we can make it a percent, and these numbers that show up as percentages, right, obviously your calculation will matter for that.
But yeah, we can make it into percent, we could do currency as we are now, and then we can select a specific currency, which I'm going to leave at USD for now, but as you can see, there's multiple currencies.
Again, let's say I want to do decimal values.
Under number preview, I can just add on decimal values, but again, we probably wouldn't want to see that for now, so we're just going to go back to just dollar value, but that is a format that you can choose.
And then again, same thing, right?
Like font weight, background color, you can give it.
Those are sort of the editing that you can do with that.
Okay, the next section is, let's say we wanted to give our matrix a bit more formatting.
So right now, currently, if you see, if I scroll down, No columns are being pinned, right?
So if I'm over here, for example, scrolling, I'm unable to know what this number is.
If it's for plan, if it's March 2027, what number is this for, right?
And then same thing with my rows.
I'm unable to see the accounts once I scroll right a bit more.
So we're going to give that a fix.
So what we're going to do is we're going to right click our income statement, our matrix.
We're going to click edit.
We're going to go into configuration.
Under configuration, we can see pinned rows and pinned columns.
So let's say I wanted the whole planned row and this period row to be pinned.
What we can do is we can click on pinned rows and put two, and that will put the first two rows to make it pinned no matter where we scroll.
Same thing with columns.
Let's say I wanted to do it one, right?
Because I just want this column to be pinned.
So we're going to quickly go ahead and do that.
And now you'll see that if I was to scroll, we can see these two column headers are staying with me, right?
No matter where I'm scrolling.
And then same thing with rows.
I can see that these numbers, for example, this is for discounts and promotions, right?
Now let's jump into the next section.
Before we jump into that, I'm going to quickly walk you through the model query so we're able to understand the next section a bit better.
So if we click on Edit Query here, we can see our columns, we have scenario and period, and then rows, we have account.
So scenario would sit at index 0, and period would sit at index 1, and for rows, account would sit at index 0.
So the reason we're again walking through this is because we'll see in the next section that it's really important for us to know what index our accounts are sitting at, like the dimensions we're bringing.
So scenario again would be zero, period would be index one, account would be index zero.
We're going to click X.
We're going to go on the space section.
We're going to go down and we're going to click on format rules.
And we're going to click add format rule.
Now, let's say I wanted the numeric values for revenue, for example, to be this whole line to be, give it a background color so I can see the whole row of revenue better.
It's more visible.
Same thing with like, let's say net income I want.
This whole row of numbers to be a bit of a background color and make it bolded.
So how would we do that?
So we would do it in like this.
We're going to go on this condition.
We're going to click meta.
We're going to write out meta.row.index.level.
And remember how we just covered index.
So all these are our accounts, right?
And if we remember correctly under our rows, account was the only dimension we were bringing.
So it would be zero.
It would index zero.
So what we're going to do is we'll index and write zero and then outside we're going to write is equal to one.
So what this is saying is if the account is only indented once, which should be our parents, right?
Because it'll sit at the lowest indentation.
Then I want to give it a dark background color, for example, right?
Let's say I wanted to hire the parent, the darker I want it to be.
So I would put it like this.
And then let's add another format rule.
Let's do meta.row.
Same thing, .index.level, and then index would be again, zero, because that is the account index that we are changing.
And I want to equal it to, let's say, let's go with four.
So the more that it is, let's say it's not a child, it's not the leaf accounts, we want it to give it like a grayish sort of five, but less darker than the other parents.
We would do a lighter color, let's say we also want to quickly edit meta.row.index.level, and we want to put index at 6, and then, oh sorry, that would be the account, right?
So that would be 0, because that's the place where you put your dimension index.
If it is, for example, 6, we can give it a lighter color, or we already did six, let's do five, right?
And now what we'll see is if we go out, our rows will be, have a background color if they are, for example, gross profit now is bolded, or is, has a background color, right?
So it's more visible for us to see.
If we scroll down, we're able to see operating expenses is highlighted, right?
All these accounts are highlighted, which makes it a bit more visible for us.
Now, now let's say we want to do the same exact thing for columns.
So we're going to go back into the Model Query to confirm our column indexes for our dimensions.
So scenario would be zero and at scenario would be at index zero and period would be at index one.
So period is our years and quarters and months, right?
So let's say I wanted to sort of give that a formatting.
So I'm going to go under space, format rules.
And then we're going to add a rule and we're going to say meta.call instead of role this time.
But then again, .index, .level.
We're going to click on this.
And then because period was at index one, we're going to say one.
If this is equal to one and for columns, the way it's going to work is one would represent years.
If we wanted to give that a darker color of gray.
We can give that a color and then we can do meta.call index.level.
And then same thing, we want to get period formatting.
And let's say this was equal to two.
What that's going to do, two is going to be the quarters.
And we want to give that a light background as well.
And now we jump out.
What we'll see is the quarters and the year columns will be highlighted.
Perfect.
Here we can see Q1 is highlighted.
Q2, Q3, Q4, and then the total year is much more darker highlighter than the quarters.
Perfect.
Lastly, let's say for the rows, we wanted to also give it another formatting rule.
We can go back here and we can say, let's say it's a leaf account, right?
And we want leaf accounts to be, all leaf accounts to have a specific format.
So we're going to go back to row.0.level and let's say they are leaf.
So instead of putting a level equal to like depending on how they are, we can say if it's a leaf, so if it's leaf, we don't want it to give a background color at all.
We can just straight up put just nothing and the font we can set at 100.
Then all the leaf accounts will be formatted just like that in our rows.
Related Articles
- Formatting Rules — the written reference for conditional formatting
- Matrix Widget: spaces & layout — where formatting is applied per space
- Matrix — the matrix widget reference