fun: Core function of wmy_1e, wmy_3e, & my_2e

Description Usage Arguments Examples

Description

Core function of wmy_1e, wmy_3e, & my_2e

Usage

1
2
3
4
5
6
7
8
9
fun(df, metric, grouping, df_rr, metric_rr, df_goal, metric_goal, df_3p9,
  metric_3p9, df_6p6, metric_6p6, df_9p3, metric_9p3, weeks_back = 4,
  week_end_dates = FALSE, week_start_dates = TRUE, cbr_ytd = FALSE,
  full_yr = FALSE, rate = FALSE, new_name = NULL, commas = FALSE,
  neg_var_paren = FALSE, div_by_1000 = FALSE, prefix = "", suffix = "",
  spark = FALSE, pop = FALSE, pop_threshold = 100, scalar = 1,
  digitsAfterDecimal = 2, op2_and_var_ph = TRUE, month_names = TRUE,
  in_mth_header_op2 = TRUE, in_mth_header_3p9 = FALSE,
  in_mth_header_6p6 = FALSE, in_mth_header_9p3 = FALSE)

Arguments

df

data frame containing metric

metric

column name from df

grouping

time diminesion column name (wk_num_in_yr, mth_num_in_yr, yr_num)

df_rr

data frame containing run rate

metric_rr

column name from df_rr

df_goal

data frame containing metric goal

metric_goal

column name from df_goal

df_3p9

data frame containing metric prediction

metric_3p9

column name from df_3p9

df_6p6

data frame containing metric prediction

metric_6p6

column name from df_6p6

df_9p3

data frame containing metric prediction

metric_9p3

column name from df_9p3

cbr_ytd

logical. Inlcude YTD definition for CBR : Actual values from last completed month

full_yr

logical. Inlcude full year summation column for month view

rate

logical. Adjust logic to handle full year for rates

new_name

name for metric output. Also creates new labels for previous year, previous year variance, etc.

commas

format values with commas. ie: 1234000 -> 1,234,000

neg_var_paren

format variance values with parenthesis. ie: -40.4 -> (40.4)

div_by_1000

also an accounting practice; divide all value by 1000. ie: 1234000 -> 1234.00

prefix

add prefix to values. ie: 2000 -> $2000

suffix

add suffix to values. ie: 20.54 -> 20.54%

spark

logical should a spark chart be added as a column in the output

pop

logical stands for Period over Period. Include percent change from previous period (ie: week 4 to week 5) next to value

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## week view
fun(
performance,
revenue,
wk_num_in_yr,
new_name = "Revenue",
commas = TRUE,
div_by_1000 = FALSE,
full_yr = FALSE,
prefix = "$"
)

## month view
fun(
performance,
revenue,
mth_num_in_yr,
new_name = "Revenue",
commas = TRUE,
div_by_1000 = FALSE,
full_yr = FALSE,
prefix = "$"
)

pkopps/biview documentation built on May 22, 2019, 2:48 p.m.