Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
eadbhard
Contributor III
Contributor III

Filter data with List Box when the expressions use Set Analysis

Hi there,

I have a line chart where the dimension is the month, and the chart has three expressions:

Expression 1   =Avg({$<Customer={'CUSTOMER NAME 1'}>} On_Time_Pct)

Expression 2   =Avg({$<Customer={'CUSTOMER NAME 2'}>} On_Time_Pct)

Expression 3   =Avg({$<Customer={'CUSTOMER NAME 3'}>} On_Time_Pct)

As you can see, each expression is selecting data for a specific customer. The chart works fine but now I want to add a List Box filter with the customer name.

image001.png

 

The field  in the "Customer" List Box is the same field used in the expressions.

When I select a customer in the List Box, nothing happens in the chart. I expected the chart to show the data of the selected customer only.

So how can I filter by customer in this chart?

Thanks for any insight!

1 Solution

Accepted Solutions
sunny_talwar

I agree with @dplr-rn , but if for unspecified reason you have to use your current approach, then change your expressions to this

Expression 1   =Avg({$<Customer *= {'CUSTOMER NAME 1'}>} On_Time_Pct)
Expression 2   =Avg({$<Customer *= {'CUSTOMER NAME 2'}>} On_Time_Pct)
Expression 3   =Avg({$<Customer *= {'CUSTOMER NAME 3'}>} On_Time_Pct)

View solution in original post

4 Replies
dplr-rn
Partner - Master III
Partner - Master III

Why not have customer as a dimension?

sunny_talwar

I agree with @dplr-rn , but if for unspecified reason you have to use your current approach, then change your expressions to this

Expression 1   =Avg({$<Customer *= {'CUSTOMER NAME 1'}>} On_Time_Pct)
Expression 2   =Avg({$<Customer *= {'CUSTOMER NAME 2'}>} On_Time_Pct)
Expression 3   =Avg({$<Customer *= {'CUSTOMER NAME 3'}>} On_Time_Pct)
eadbhard
Contributor III
Contributor III
Author

@sunny_talwar Worked like a charm! Thanks a lot.

eadbhard
Contributor III
Contributor III
Author

This approach also work wonders. For other new users like me:

  • Add the Customer as a Dimension
  • Leave one Expression only
  • Remove the Set Analysis query from the expression

Great answer, thanks!