Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
VENKY_A
Contributor II
Contributor II

Chart expression should react to only few fields

Hi All,

I have Bar chart and my report has many filters Like Market, Market unit, Country, period, industry, client etc.,

My Chart should reach to only Market and Period filters. for any other filter my chart should not react.

I have solution but i have many filters and i cannot keep adding all of them. so looking for an alternate.

Option-1:

This is making my chart static but not reacting to Market and period

Sum({1}NWD)

Option-2:

This option is working but i dont want to use all the filters here. is there any alternative.

Sum(${<Country=,Client=,Industry=.....>}NWD)

Labels (1)
10 Replies
Or
MVP
MVP

VENKY_A
Contributor II
Contributor II
Author

No, that is not the expected. I want only market filter should work on the chart. for any other filters the chart should remain static. 

Or
MVP
MVP

That's exactly what the link describes, near as I can tell? Ignoring all filters except one.

VENKY_A
Contributor II
Contributor II
Author

Let me elaborate on this. My chart is not having any other filter values in it, it has only market and period columns in it. So when ever we select a other filter value it is disappearing.

Also as suggested in the link i have changed the expression as below, but the chart is not reacting to market filter also.

Sum({1<Market=$::Market>}[Chargeable hours])/Avg({1<Market=$::Market,Flag = {1}>}NWD)

Or
MVP
MVP

I tried to replicate what you're describing with some sample data, since I don't have access to your data.

Load * INLINE [
Market, Period, Hours
Market1, Period1, 10
Market1, Period2, 20
Market1, Period3, 30
Market2, Period1, 1
Market2, Period2, 2
Market2, Period3, 3
Market3, Period1, 5
Market3, Period2, 10
Market3, Period3, 15
];

Expression formula: Sum({1<Market=$::Market>}[Hours])

When a market is selected:

Or_0-1637743182712.png

 

 

When something else, such as Period, is selected:

Or_1-1637743212333.png

 

This appears to be the behavior you're expecting, so if it's not working on your end, I'd suggest you check whether something else is interfering - perhaps the Flag = {1} part?

VENKY_A
Contributor II
Contributor II
Author

Okk Here is an sample chart attached.

Assume the right side list boxes are all filters in the report. But Industry is not part of the Chart table. So when ever we select a value from Industry the chart disappears. So I want Company and Market Filter should work and when we select Industry chart should not impact.

VENKY_A_0-1637750971957.png

If it is one or few filters then i can use something like this. But i have a big list of filters and i dont want to write all of them in the expression.

Sum(${<Country=,Client=,Industry=.....>}ChargeHours)

Hope this is clear now.

Or
MVP
MVP

When I select a value from "Industry" using the suggested formula, the chart does not disappear...

Or_0-1637751681416.png

 

VENKY_A
Contributor II
Contributor II
Author

Okk 😊

In my case my report has 3 sheets one for each company. in Sheet-1 i have to show only company 'A'. So we are freezing the field Company and all the data shown in the report will show only A. 

If i use the suggested expression it will all companies data. So I also tried something like this but did not work.

=sum({1<Company = {'A'},Market=$::Market>}ChargeHours)

One fixed filter and one changeable.

Or
MVP
MVP

This still works with your sample QVW, so I'm not sure what the problem is.

Selecting a company doesn't impact the chart, as it shouldn't (it should always be A)

Selecting an industry doesn't impact the chart, as it shouldn't (should be ignored)

Selecting a market impacts the chart (selecting America will result in no values being displayed because there are no values for America within Company = A)