Last active
July 7, 2020 23:23
-
-
Save Tadge-Analytics/58a49896a5648175f95b3b61af67f653 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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