Instead of repeating the entire question, this is exactly what I'm trying to accomplish:
I have two data sources.
One of which creates a visualization along with filter of the following values:
foo
bar
baz
and another which contains the value I want the reference line to be set at based on the filter selection:
selection value
foo 10
bar 20
baz 50
Where a filter selection of foo
would set a reference line at 10
, bar
at 20
, baz
at 50
, foo
and bar
at 30
, foo
and baz
at 60
, bar
and baz
at 70
, etc.
Is there some combination of parameters or calculated fields I can use to show the appropriate reference line value from data source 2 based on the filter selection from data source 1?
Edit: Grammar
Two options:
You can point a reference line to a calculated field.
You can create a dual axis viz with bars and a dynamic line chart.
First, map your values. We'll use this for a dual axis chart as well.
Create a calculated field [ref_mapping]
that will map the values you need:
CASE [director]
WHEN 'foo' THEN 10 //if your [value] column already has the number you need ***AND is already mapped to your directors***, you can replace 10 with [value]
WHEN 'bar' THEN 20 //[value]
...
END
Second, make your values dynamically change based off the view filter.
Next take a windowed sum of [ref_mapping]
so it only calculates based off what the view is filtered to (This assumes [director]
is in the filter pane).
Make a new calculated field called [dynamic_ref]
:
WINDOW_SUM([ref_mapping], FIRST(), LAST())
Now go to analytics pane and add a reference line by dragging it to your viz. Edit the reference line by selecting the value from drop down. The field [dynamic_ref]
should now available to use as reference line.
SUM([Sales])
and SUM([ref_mapping])
).SUM([Sales])
) and Line is selected for the actual reference values (such as SUM([ref_mapping]
).