Table calculations of totals and row totals?

Question:

In past I know that table calculations werenโ€™t allowed for totals. See [RETIRED]Why don't my table calculations have totals? .

I donโ€™t quite see why table calculations couldnโ€™t simply work on total rows in the same way they work on regular rows. Is it because some table calculation formulas would work on regular rows but return misleading results on total rows? I could see the mixing of null and non-null values being tricky for calculations using mean() and others, but SQL has the same issues and deals with them. Admittedly, sometimes the way SQL deals with them is very confusing to users and I could imagine that Looker would prefer to err on the side of caution.

Or has this changed?

Thanks!

7 56 15K
56 REPLIES 56

Hiya Ethan,

See my answer in Why don't my table calculations have totals?.

Was that answer what you were looking for?

Thanks,
William

@William_Lane No, what Iโ€™m asking is this: if you click โ€˜Totalsโ€™ in the UI, you get an additional row on the bottom, the totals row. So, why canโ€™t a table calculation (Iโ€™m thinking here of a table calculation which doesnโ€™t use any โ€œ:totalโ€ fields) operate on that row in the same way it operates on every other row?

Hey Ethan - I think itโ€™s because measures are not guaranteed to be additive or follow line behaviour at the totals row. However i do agree it would be great if there were an option to โ€˜apply on total rowโ€™ (with a warning) so that the same calculation could be applied at the total row level.

Hi Ethan,

This is great feedback for the product team and clearly from Alexโ€™s comment you arenโ€™t the only one who is interested in this topic. Building a little on Alexโ€™s and Williamโ€™s comments here is some more background on what our product team is facing in this area:

Since row totals are a different series in and of themselves, we canโ€™t have table calcs necessarily โ€œcontinueโ€ on to apply to the totals row without causing quite a bit of confusion. i.e is that value a total of the table calc column or is it the table calc applied to the row totals? In most cases these would be very different numbers

ceik
New Member

Was also just looking for this and surprised itโ€™s not possible. I can see the challenges with regards to implementation, however I think this is a pretty essential feature with some very basic use-cases. There should be an option that lets me chose how the table calculation should be computed for the totals and they should probably be turned off by default.

Hey @ceik,

We appreciate the feedback. This feature has been on our Product team radar for some time. The challenge here is that totals mean two different things. We canโ€™t do a unique total with a table calc, so weโ€™d have a lack of parallelism between the two totals which feels problematic to us. However it is something our Engineering team is looking into. Hope this clarifies it for you.

Regards,

Sasha

Britt1
New Member

Adding my vote that this would be a very useful feature.

+1 for this feature.

+1 for this.

Are there any updates on progress / work-arounds / or other fixes on this?

+1 for this as well

+1 from me as well. Do we have any updates from the Engineering team since July of last year? Thanks!

Hi Andrew,
No updates from engineering/product but all of the +1s here are being considered. Thanks for checking in!

+1 would want to have this.

+1 as well

+1 here as well, this is a very commonly requested capability

+4 from WB/TBS as well, (I am building dashboards for four separate clients so far, and three ask for this everytime they see a table without total calculations, and one is about to get their first table without total calculations.)

One other approach is to take the values out of the table calculations and put them into the base view. I was previously doing some table calculations to determine Week over Week growth by offsetting rows, etc.

To get around the limitations of the table calculations though, I have added the last week numbers inline with the current numbers, and then added the percentages to the view. These percentages get calculated across all the rows including the cumulative total rows.

  measure: weekly_sub_growth {
    type:  number
    sql: (${total_paid_subscriptions}::numeric/${total_lastweek_subscriptions})-1.00 ;;
    value_format_name: percent_1
  }

There are often ways to work around the limitations of Looker if you take the time to materialize the data as you need it displayed.

Hi John- looks like youโ€™ve made a good use case here! Iโ€™ll also add your previous +4 to the product teamโ€™s list for this request.

Cheers.

Mason1
New Member

+1

this is an essential feature and hope to have it available soon

+1 from me
+2 from my engineers who wish Looker had this feature
+3 from my analysts who avoid using Looker because it lacks features like this

Thanks, @jbroberg, Iโ€™ve passed along your feedback to the Product team. And thank you for the details on who in your company is interested in this feature.

Iโ€™ll add my +1 to the pile.

+1. Analysts here ask about this regularly.

Alexr1
New Member

Adding a +1 in hopes this gets prioritized

+1 here.

Astonishing that this has been open so long. Seems like a very small thing to implement.

+1 for this feature

Just an update on this, folks - the Product team is still actively considering adding table calc totals and they are well aware of the level of demand that exists for this feature. It might be worth checking back with us in a few weeks as there may be a positive update by that time.

+1 on this ๐Ÿ˜Ž

Hey @Ezra_Wolfe,

I was sure to relay the feedback to the product team. Thanks for letting us know that this is something youโ€™d like to see!

Cheers,

Leticia

As of Looker 6.2, table calculations now work with totals. See this documentation page for more information.

@marieb does the table calc have to be in a certain format/measure? I donโ€™t see the feature working as expected (testing Looker 6.4)

What about it donโ€™t you see working? The thing to remember with totals is that they run the same function as the column, but only over the totals rowโ€” So a mean() table calculation will return mean(total), not the sum of the values in that column.

Something like stdev() for example, which requires multiple values, will return 0, since itโ€™s trying to execute over just the totals row/1 value. Does that click with what youโ€™re seeing?

I created a table calc that is an integer multiple of a column in the results and expected the sum of the individual values in that column. from your response seems this shouldโ€™ve still worked since integer*(sum of values) = sum of (values*integer), however Iโ€™m seeing a NULL result.

Perhaps, when no functional operators are used there should be a default behavior?

That use case does sound like it ought to workโ€ฆ I just tried 5.0*${table.count}and itโ€™s correctly doing 5*${table.count:total} for the totals row. Whatโ€™s the full formula youโ€™re using?

The default behavior idea is not a bad thoughtโ€” Like for your example, then by default it would be just a sum total (what most people think of when they think total). Iโ€™ll bring that up internally.

The question is, does it get too confusing to have different behaviors for the same feature? Itโ€™s hard to message that properly with a good UI/UXโ€ฆ

Ah, I see the issue. The Look Iโ€™m debugging is performing a dimension * integer (the dimension is a type: number)

I was able to work around this by:

  • didnโ€™t work: created a table calc referencing the dimension, then another table calc referencing this. seems this produces a table calc that behaves like a dimension too for this feature.
  • worked: created a sum custom measure referencing the dimension, then created a table calc referencing this custom measure which accurately produced the sum of dimension * integer I needed

Aaah, that makes sense. Nice job!

Any update on this?  Not able to see any Table Calc totals 

any updates on this function? I really need this to work.

Isaac1
New Member

So if Iโ€™m reading @izzymillerโ€™s comment correctly, the total of a table calculation column isnโ€™t a sum of the column but rather applies the same calculation against the measureโ€™s total? If so, iโ€™m surprised this isnโ€™t a feature yetโ€ฆ there should be an option to have the table calculation columnโ€™s total sum the values within its column. 

For example, I have a daily measure of orders and a table calc of the delta vs. the prior day. Iโ€™d like to see what the total delta for the period is. 

offset(${orders_daily.total_orders}, -1) - ${orders_daily.total_orders}
Top Labels in this Space