Lompat ke konten

Pelajaran 25 ยท Projects and Reference

Project: Budget vs Actual Planner

Build a budget versus actual planner in Sigma with an input table, variance rules, approval status, commentary, permissions and clear testing steps.

Your second project is a small planning app: department owners enter a monthly budget, see actual spending, explain big differences and submit for approval. It uses input tables, rollups, conditional logic, actions and security. This is a learning exercise, not financial or accounting advice; your organization's finance rules come first.

The brief

  • Users: department owners and a finance reviewer.
  • Inputs: budget amounts and comments.
  • Data: actual expenses loaded from the finance system.
  • Rules: a variance over 10 percent needs a comment. This threshold is only an example.
  • Access: owners work only on their department; finance reviews all.

The tables

Table Type Grain Columns
actuals Source table One expense line department, month, category, amount
budget Empty input table Department and month row ID, department, month, budget, comment, status
data_status Source table One month month, load_complete

Give each input row a stable ID. Use fixed lists for department and status so users cannot invent spellings. Follow the input tables advice on keys, write setup and validation. Use invented figures for practice.

Variance rules

Define signs clearly. Here, variance = actual minus budget. For expenses, a positive variance means overspending.

TEXT
Actual       Rollup(Sum([actuals/amount]),
                    [department], [actuals/department],
                    [month],      [actuals/month])
Variance     Zn([Actual]) - [budget]
Variance %   If(Zn([budget]) = 0, Null, [Variance] / [budget])
Flag         If(Zn([budget]) = 0, "No budget",
                Abs([Variance %]) > 0.1, "Explain", "OK")

Note the choices. Zn([Actual]) treats "no expense lines" as zero spending, which is reasonable only if the month's actuals are completely loaded. A month whose data has not arrived must not look like "zero spent", so show the load status for each month.

SQL Stand-in: variance and flags with SQL

Press Run (or Ctrl + Enter) to see the result here.

Design is 15 percent over and needs an explanation. Support is 5 percent under. Legal has a zero budget, so its percentage is undefined.

The page

Zone Content
Header Month control, load status, short instructions and the sign rule
KPIs Total budget, total actual, total variance
Planner Budget input table with calculated flags and comments
Review Rows waiting for approval

Workflow and status

Use a clear status list: Draft, Submitted, Approved and Returned.

flowchart LR
  D["Draft"] --> S["Submitted"]
  S --> A["Approved"]
  S --> R["Returned"]
  R --> S

Only valid status moves should be possible.

Add buttons with actions: Submit (only if a required comment exists), and Approve and Return (for the reviewer). Add conditions so each button runs only when allowed. Remember that a hidden button or a condition in the interface is not a full security control: permissions and data rules must stop the wrong users. If you cannot enforce a rule in Sigma and your platform, do not present the status as a formal approval.

Python Stand-in: allowed status changes

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Locking and history

Decide what happens after approval. Options include a locked period, a new version row for each change, or an approval snapshot taken in the data platform from a warehouse view. An approval that can be silently edited is not reliable. Check what Sigma's edit log records, and ask finance what audit evidence is required before relying on it.

Security

Apply row-level security so that owners see only their department, and design entry permissions with the same care. Reading restrictions do not automatically control who may type. Test entry, buttons and totals as an owner, as a different owner and as finance. Check what a person with explore access can do. Review who can export the planner.

Test plan

  1. A zero budget shows "No budget", not an error.
  2. A month with unloaded actuals is visibly marked.
  3. A flagged row cannot be submitted without a comment.
  4. Owners cannot approve.
  5. Totals equal the sum of the department rows.
  6. Duplicate budget rows for a department and month are detected.

For the last test, add a check that counts budget rows per department and month and shows any count above one. A duplicate would count the same actuals twice in the totals.

Extensions

Add a forecast column, a list of reasons for variances, or a chart of budget against actual over the year. You could also send a reminder by scheduled export, if your policy allows.

Common mistake: mixing up the sign of variance between teams. State in the header whether positive means overspending or underspending, and keep it the same everywhere.

Rolling it out

Start with one department and one month before you invite everyone. Ask the owner to enter a budget, submit a row that needs a comment, and try to do something they should not be able to do. Watch where they hesitate, because unclear labels cause more problems than formulas.

Next, ask the finance reviewer to return one row and approve another. Check that both people can tell what happens next. Write a short help text on the page that lists the steps, the deadline owner and the contact for problems.

Before the wider launch, agree how corrections work after approval, who can reopen a month, and how long entries are kept. Also decide how the planner's data reaches other reports, usually through views that your data team creates in the platform. Run your test plan again after each change to the layout, permissions or source tables.

What this project teaches

The formulas are short. The harder work is agreeing on meanings: what counts as actual spending, when a month is complete and who may change a number. Settle these with the people responsible before you polish the layout.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Why is a zero budget handled specially?

    Dividing by zero has no meaning, so return null or a label.
  2. 2. What should protect approval from department owners?

    Hiding interface elements does not enforce who may change data.
  3. 3. Which problem can duplicate budget rows cause?

    Each duplicate row repeats the looked-up actuals.
  4. 4. When is it wrong to show missing actuals as zero?

    Missing data is different from no spending.

Summary

  • Combine source actuals with input tables using stable keys.
  • State the variance sign and handle zero budgets and missing data.
  • Use statuses and conditioned actions for the approval flow.
  • Enforce access with permissions and security, and keep history.
  • Test edge cases with real roles.

Next: Glossary and Cheat Sheet

Progres Anda disimpan di browser ini. Tidak perlu akun.