Created a calculated column for WoW comparisons. Is there a way to exclude instances where all values are null in the calculated column for the last column where there is nothing to compare against?

Here are my calculation formulas:
YOY - ${order_items.total_gross_margin} - offset(${order_items.total_gross_margin},-1)
YOY Is Not Null - NOT is_null(${yoy})
Transposing is an option that will be available in our new table viz that is currently in beta. More details on that here - Table Next Options
The workaround we found was to include the WoW calculation in the actual data itself which took some sql work to get it to work; it would provide WoW for every week; we then used a table calculation to only choose the last week and we hid the actual WoW columns that we included.
Not an ideal solution, but it worked. We also used a “Week” title column because we were including weeks and months in the same report
pivot_where(${ops_3p_wbr_ooc_visits_details_subt.date_type} = “1-WEEK6”, ${ops_3p_wbr_ooc_visits_details_subt.previous_lost_orders})
pivot_index(${yoy_revenue_change},1)
Then we can hide the original calculation from the visualization and just return the value for the year that isn’t null:

Moving the calculation into the model as per Joseph’s example also works.
I have the same question.
Thanks,
Manoj
Hi yes, no
as a value.
Hi There. Does anyone have a solution or workaround to this issue? There seems to still be no option to hide a column when the column contains only NULL values.
Recently tried to deploy this solution for a similar problem but when I go to filter out the “No” by clicking on the Yes/No table calculation I’ve created it doesn’t even give me the option anymore… I’m running Looker 4.18.
I believe this is easily reached with a simpel filter on the column that must NOT be only NULL values, and set it to: IS NOT NULL
.
That way, it will only show columns with at least one value that IS NOT NULL
.
I think this mainly works because the WHERE NOT <field> IS NULL
clause is applied BEFORE the pivoting takes place. So any column with only NULL’s is deleted this way.
Note: It will also take away all rows that only have NULL values. So you have to be sure that there will be a value for each row in at least one of the other columns.
Reply
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.