Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
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

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

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

Not applicable

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

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

Not applicable

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

Maybe this

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

Not applicable

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

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

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

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

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

Not applicable

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

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 !

MVP
MVP

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

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

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

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])

MVP
MVP

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

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.

Community Browser