How to ignore filter context on the calculation of totals

Beto
Participant II

Hello everyone,

I am new to looker and I am figuring out several things still. I want to perform a calculation on the total row however that total row is being affected by my filters which i dont want to do.

Shop Sales
A 10
B 10
Totals 20

What I want is to filter by Shop A but still show the total amount of sales I had.

Shop Sales
A 10
Totals 20

How can i achieve this?

1 3 4,483
3 REPLIES 3

Dawid
Participant V

Filters (custom and field filters) are applied as WHERE clauses in the SQL, which means they will affect the total.

You would have to use Table Calculations to show what you need. For example, you leave both A & B. Then you create calculation   <field> / total
Then you create another table calculation that says IF(<field> = “A”, yes,no) and in your data table you can click on the gear icon and choose “Hide Nos from visualisation”. I think this is the only workaround.

If you want to have access to your totals with filters applied, you’d have to have this data in your source.

Beto
Participant II

@Dawid how about a way to filter results on my explore , based on another filter i selected from the dashboard.

I have a dashboard with a table showing category and area with the proper sales measure.

Category Area Sales
c1 a1 10
c2 a1 10

Then on the right i would like a second table showing me the market values but still focusing on only those areas which correspond to X category. So if i filter by “c1” it would show me something like this.

Category Area Sales
c1 a1 20

this is the value of the market corresponding to “a1”

In reality i need to filter by the selected category but still take into account the rest of the values so i can use them in the aggregation of sales.

How can i achieve this behaviour ?

Dawid
Participant V

I’m not sure where the 20 comes from, since your first table has c1 and c2, but regardless, I think this is something you won’t be able to get with filters alone. You want to have filtered value against a total, in the end it goes back to what I said before, can’t preserve the overall context when using filters, because filters change the context (WHERE). 

You also can’t join separate tiles in the Dashboard and reuse their data.

Top Labels in this Space
Top Solution Authors