Skip to contents

[Experimental]

This function enables you to create a summary table to validate organizational data. This table will provide a summary of the data found in the Viva Insights Data sources page. This function will return a summary table with the count of distinct fields per HR attribute and the percentage of employees with missing values for that attribute. See hrvar_count() function for more detail on the specific HR attribute of interest.

Usage

hrvar_count_all(
  data,
  n_var = 50,
  return = "message",
  threshold = 100,
  maxna = 20
)

Arguments

data

A Standard Person Query dataset in the form of a data frame.

n_var

number of HR variables to include in report as rows. Default is set to 50 HR variables.

return

String to specify what to return

threshold

The max number of unique values allowed for any attribute. Default is 100.

maxna

The max percentage of NAs allowable for any column. Default is 20.

Value

Returns an error message by default, where 'text' is passed in return.

  • 'table': data frame. A summary table listing the number of distinct fields and percentage of missing values for the specified number of HR attributes will be returned.

  • 'message': outputs a message indicating which values are beyond the specified thresholds.

Examples

# Return a summary table of all HR attributes
hrvar_count_all(pq_data, return = "table")
#> # A tibble: 6 × 4
#>   Attributes          `Unique values` `Total missing values` `% missing values`
#>   <chr>                         <dbl>                  <dbl>              <dbl>
#> 1 FunctionType                      8                      0                  0
#> 2 IsActive                          1                      0                  0
#> 3 LevelDesignation                  5                      0                  0
#> 4 Organization                      4                      0                  0
#> 5 SupervisorIndicator               3                      0                  0
#> 6 WeekendDays                       2                      0                  0