# Part 3 - Accrual-Based Accounting

### Hint #1

The first part is about splitting the data set in two streams. We only want to adjust when we have some data in our *Payment* column. So the beginning is about splitting the general ledger data with two Filter tools.

<div data-full-width="true"><figure><img src="/files/hqd36P8ykAj1PeZU6Fcv" alt=""><figcaption><p>The first section of Part 3</p></figcaption></figure></div>

Then we use an IF Column tool to generate a column that specifies the number of months a payment is accounting for. If the payment is monthly then 1 (month), if the payment is quarterly then 3 (months) and else 12 (i.e. because it must then be yearly).&#x20;

***

### Hint #2

The second section is where things get interesting. We want to use our newly creating Months column to generate a row for each month the payment is accounting for and the divide the amount by each month. So if an original payment of 150 is quarterly and hence accounting for 3 months, we want to have 3 rows with an amount in each of 50 (=150/3).

<div data-full-width="true"><figure><img src="/files/OxchrpTZZX9R2zPHqNvj" alt=""><figcaption><p>The second section</p></figcaption></figure></div>

The Create Rows is relatively simply to configure. You input the column the specifies the number of rows you want to create from each original row - that's our *Months* column. Then you input (optional) the column you want to disaggregate - that's our *Amount* column.<br>

<figure><img src="/files/nCX3DtXafBrnp1u3tfJn" alt=""><figcaption><p>The Create Rows configuration</p></figcaption></figure>

***

### Hint #3

In this section of Part 3, we want to create an adjusted Date column for our new rows. With the output from Hint #2, we have a bunch of new rows for each value in the Month columns with disaggregated Amounts. **But the Date looks like it is on the same date (from the original transaction.** This is what we want to correct. The section looks like this:

<div data-full-width="true"><figure><img src="/files/k3fGzEzrIb179yWX2wPw" alt=""><figcaption><p>The third section</p></figcaption></figure></div>

In short, this is what happens:

1. We make our original date column into a Text format (Tool ID 34)
2. We split that column by "-" (Tool ID 33)
3. The transform the Day part of the splitted columns called Date\_2 and take only the first two characters with a Transform tool (config: left = 2)
4. Then we split into three streams of data with Filter tools - one stream for each type of Payment / Months
   1. Top + Middle stream: we adjust with custom formulas (IF Column) to create a correct date. First by figuring out if the date is in a new year and then figuring out the new month - you can look at the screenshots for the formulas. We use a Text Column tool to assemble our new date<br>

      <div data-full-width="true"><figure><img src="/files/s2B6X4YdJlTXsaJzn8gj" alt=""><figcaption></figcaption></figure></div>
   2. The Months == 1 doesn't need any adjustment because if the Months = 1 then the Create Rows didn't generate any new rows and the Date is correct

***

### Hint #4

In the final section of Part 3, we merge our datasets together with Stack tools. The Green part to the right is exactly the same is in Part 1 - Profit & Loss. We simply switching out the Generel Ledger input data with what we've built in the exercise. You can then run everything and the Income Statement at the end will change because you adjusted the Date column of the transactions which is what is used to generate the Income Statement.

<div data-full-width="true"><figure><img src="/files/rgFEcNyat8LSTx1eLKHZ" alt=""><figcaption></figcaption></figure></div>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://resources.less.tech/less-tech/exercises/automated-financial-analysis/hints/part-3-accrual-based-accounting.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
