Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Is it possible to link Filter panes to functions in other Charts

Hi,

Is there a way to link the conditional value in an expression based on a filter pane's value?

Ex - Let's say - i have a filter that selects two values 'A' and 'B'. I have a bar chart that sums values based on the following :

Sum({<={'<=2'}>} Sales) /Sum(Sales)).

Can i make the field where I have the var A dynamic based on a value I select from a filter pane? Like some sort of  -

Sum({<[Value selected in Filter Pane]={'<=2'}>} Sales) /Sum(Sales)).

Thanks

Malvika

9 Replies
sunny_talwar

AFAIK this isn't possible. What are you trying to accomplish here?

Not applicable
Author

I want to make the data selection dynamic based on the value my filter is giving

Not applicable
Author

Maybe this

Sum({<'$(GetFieldSelections(Filter))'={'<=2'}>} Sales) /Sum(Sales))

Not applicable
Author

Hey Caleb, thanks for the input. I have multiple filter panes on my worksheet. I am trying to reference the one i want by the name of the dimension, but it doesn't work. Am i going wrong somewhere?

SUM({<'$(GetFieldSelections(DimensionName)) = {'<=2'}>} [Sales])/Sum([Sales])

Not applicable
Author

Looks like you're missing a single quote after the second parenthesis after DimensionName

SUM({<'$(GetFieldSelections(DimensionName))'= {'<=2'}>} [Sales])/Sum([Sales])

Not applicable
Author

Oh, my bad -  my actual code had the single quote. The challenge i am facing right now is if i have multiple filter panes on the same wroksheet. How will it know whic one to reference - by the dimension name on which the filter is created? Because that doesn't seem to work for me !

jagan
Luminary Alumni
Luminary Alumni

Hi,

Do you select multiple or single values?

For Single Values

If(Only(DimensionName) <= 2, SUM([Sales])/Sum([Sales]))

If you are selecting multiple values then

If(GetSelectedCount(DimensionName) >0, Sum(Aggr(If(DimensionName <= 2, SUM([Sales])), DimensionName))/Sum([Sales]))


Hope this helps you.


Regards,

Jagan.

Not applicable
Author

Yes it will be on the dimension name.  Can you attach an example so I can help better?  I've attached an example for you to look at.  Hopefully it helps

In the meantime, you can try this expression

SUM({<'$(=GetFieldSelections(DimensionName))'= {'<=2'}>} [Sales])/Sum([Sales])

jagan
Luminary Alumni
Luminary Alumni

HI,

I am not sure what you are trying to do, can you attach some sample file and your expected results so that it would be easier to provide solution.  Are you trying to get the ratio of selected values and overall data?

=Sum(Sales)/Sum({1} TOTAL Sales)

{1} - Ignores selections in all fields

TOTAL - Ignores all dimensions in the chart.

Hope this helps you.

Regards,

Jagan.