Skip to content

Commit

Permalink
[pt] Improve item selection and fix slicers names with whitespace (#842)
Browse files Browse the repository at this point in the history
* [pt] pass characters to item_order

* [pt] allow slicer variables to contain whitespaces
  • Loading branch information
JanMarvin authored Nov 8, 2023
1 parent f50620e commit 53aef14
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion R/class-workbook.R
Original file line number Diff line number Diff line change
Expand Up @@ -1522,7 +1522,7 @@ wbWorkbook <- R6::R6Class(
sel <- which(pt$name == pivot_table)
cid <- pt$cacheId[sel]

uni_name <- paste0(slicer, cid)
uni_name <- paste0(stringi::stri_replace_all_fixed(slicer, ' ', '_'), cid)

### slicer_cache
sortOrder <- NULL
Expand Down
2 changes: 2 additions & 0 deletions R/helper-functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,8 @@ get_items <- function(data, x, item_order, slicer = FALSE, choose = NULL) {

if (is.null(item_order)) {
item_order <- order(dat)
} else if (is.character(item_order)) {
item_order <- match(dat, item_order)
}

if (!is.null(choose)) {
Expand Down

0 comments on commit 53aef14

Please sign in to comment.