Skip to main content
Question

Is there a way to pass a default value for Stackby property in yaml?

  • January 30, 2023
  • 2 replies
  • 3 views

pavan.bhara13
Level 4
Forum|alt.badge.img

we are having a bar chart with a single KPI but stacked by multiple selections. we want to set a default stack when no stacking option is selected when the dashboard is accessed. Is there any way to do so?

 

Snippets attached for reference.

2 replies

abhishek.chatu14
Level 11
Forum|alt.badge.img+4

You can use an if-else statement to achieve this. A good option would be to assign a default value to the variable. When the variable is equal to the default value, use the default stackby, otherwise use the variable itself.

The syntax would look like this:

${a == 'Bob Broo' ? 'Table.Column' : a}

Here, "a" is the variable and the default value is "Bob Broo".


abhishek.chatu14
Level 11
Forum|alt.badge.img+4

PS: don't keep any space while using the if else statement may throw an error