Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Histogram visualization crashes when using labels generated with liquid from templated filters #8

Open
boelefrits opened this issue Jul 30, 2021 · 0 comments

Comments

@boelefrits
Copy link

I receive the following chrome console error while trying to create a histogram with the viz-histogram-marketplace visualization:

Uncaught (in promise) Error: Expression parse error: ({"First
    
    "templated_filter_value_event_1"
    
  ": !isValid(datum["bin_step_15_fct_funnel_avg_days_first1_first2"]) || !isFinite(+datum["bin_step_15_fct_funnel_avg_days_first1_first2"]) ? "null" : format(datum["bin_step_15_fct_funnel_avg_days_first1_first2"], "") + " – " + format(datum["bin_step_15_fct_funnel_avg_days_first1_first2_end"], ""), "Count of Records": format(datum["__count"], "")})
    at l (marketplace-api.looker.com/viz-dist/histogram.js:1)
    at Xw (marketplace-api.looker.com/viz-dist/histogram.js:20)
    at bk (marketplace-api.looker.com/viz-dist/histogram.js:20)
    at mk (marketplace-api.looker.com/viz-dist/histogram.js:20)
    at gk (marketplace-api.looker.com/viz-dist/histogram.js:20)
    at AA (marketplace-api.looker.com/viz-dist/histogram.js:20)
    at marketplace-api.looker.com/viz-dist/histogram.js:20
    at Array.forEach (<anonymous>)
    at sD (marketplace-api.looker.com/viz-dist/histogram.js:20)
    at uD (marketplace-api.looker.com/viz-dist/histogram.js:20)

The reason for this is that the measure I am trying to show in the histogram, has a label of the following form:

  filter: event_1 {
    label: "1. Choose event 1"
    case_sensitive: yes
    suggest_dimension: eventname_suggestions.event_name_cleaned
    suggest_explore: eventname_suggestions
  }

measure: sum {
label: "
    First
    {% if fct_funnel.event_1._is_filtered %}
    {{ _filters['fct_funnel.event_1'] }}
    {% else %}
    event 1
    {% endif %}
    to first
    {% if fct_funnel.event_2._is_filtered %}
    {{ _filters['fct_funnel.event_2'] }}
    {% else %}
    event 2
    {% endif %}
    "
type: sum
}

If I remove the label, the visualization does work.

Any idea how to fix this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant