Skip to content

Instantly share code, notes, and snippets.

@lparolari
Last active December 24, 2022 14:31
Show Gist options
  • Save lparolari/d00d96391c6844c6a611ced64283facc to your computer and use it in GitHub Desktop.
Save lparolari/d00d96391c6844c6a611ced64283facc to your computer and use it in GitHub Desktop.
round(
if(
prop("Budget") > 0,
if (
prop("Spent") > 0,
prop("Spent") / prop("Budget"),
if (
prop("Spent") < 0,
1 - abs(prop("Spent")) / prop("Budget"),
0
)
),
if (
prop("Budget") == 0,
if (
prop("Spent") < 0,
-1,
if (
prop("Spent") > 0,
1,
0
)
),
0
)
) * 100
) / 100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment