Bar Chart with Custom Field Values and Employees

Hello Looker Brains!

I have a unique request with Custom Field Values pulled from a form. The form is asking how many and an expression is required to convert the values to numbers with the to_number(${ticket_ticket.field_1_value}). We are looking for a bar chart similar to this:

Money_Honey_0-1713187439486.png

Where each bar is calculating off the expression. Is this possible? Thank you for your brain power!

0 5 144
5 REPLIES 5

I'm not sure I understand. Does each "custom field value" have four smaller values in it? Or maybe my real question is, what do the colors of the bars represent?

Each "custom field value" has a number for each employee. Each bar represents each employee.

Hm, I'm still not following. Can you share a mockup of how the data looks in a table? 

The Custom Field 1 is pulling in a number that the employee entered on the form. An expression was created to convert that data from text to a number in an Expression: to_number(${ticket_ticket.field_1_value}). There are 5 employees, 1 employee per bar in the 5 different groupings of workplace. 

Money_Honey_0-1715288230194.png

 

Thanks so much for sharing the table! This really helps me understand. 

The best practice here would be to create a measure in LookML for each of the custom values. You can use the "max" measure type since it will just return the same value as the custom value when you're grouping by employee.

 

measure: custom_value_1_measure {
  type: max
  sql: ${custom_value_1} ;;
}

 

Then you can select each of those measures alongside the Employee dimension. You'd get one set of bars for each employee, with each set containing each of the custom values. I know it's kind of the opposite of the chart you wanted, but hopefully it still conveys the information you're looking for?

I made a mockup of what I'm talking about:

Screenshot 2024-05-10 at 3.46.34 PM.png