Skip to content

Instantly share code, notes, and snippets.

@Tadge-Analytics
Last active July 7, 2020 23:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tadge-Analytics/58a49896a5648175f95b3b61af67f653 to your computer and use it in GitHub Desktop.
Save Tadge-Analytics/58a49896a5648175f95b3b61af67f653 to your computer and use it in GitHub Desktop.
library(tidyverse)
library(lubridate)
actuals <- seq.Date(today() - 400, today(), "day") %>%
tibble(Date = .) %>%
crossing(
`Reporting Level 1` = paste0("Level 1_", LETTERS[1:3]),
`Reporting Level 2` = paste0("Level 2_", LETTERS[1:3]),
`Reporting Level 3` = paste0("Level 3_", LETTERS[1:4]),
`Fund Strm` = c("CAPEX", "OPEX")
) %>%
mutate(`SAP Version` = "ACTUALS",
Amount = runif(n(), 2, 25))
budget <- seq.Date(today() - 400, today() + 400, "month") %>%
tibble(Date = .) %>%
mutate(Date = floor_date(Date, "month")) %>%
crossing(
`Reporting Level 1` = paste0("Level 1_", LETTERS[1:3]),
`Reporting Level 2` = paste0("Level 2_", LETTERS[1:3]),
`Reporting Level 3` = paste0("Level 3_", LETTERS[1:4]),
`Fund Strm` = c("CAPEX", "OPEX")
) %>%
mutate(`SAP Version` = "BUDGET",
Amount = runif(n(), 2, 25)*30)
bind_rows(actuals, budget) %>%
openxlsx::write.xlsx("example data.xlsx", asTable = T)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment