I am using a calendar table to list all months this year with table calculations. I need the whole table populated to correctly calculate cumulative sums but I would like to choose to display only the value for current month.
Is it possible?
I am using a calendar table to list all months this year with table calculations. I need the whole table populated to correctly calculate cumulative sums but I would like to choose to display only the value for current month.
Is it possible?
Dawid, I wonder if you can use the “Limit Displayed Rows” option in the visualization settings to do this.
You can Hide/Show the first/last x rows from the viz, while maintaining the underlying results/calculations.
I thought you’d said that. Unfortunately it’s neither first nor the last row that I need. It’s the row that matches something (eg. current month) but all rows have to be present in the data in order for everything to be calculated correctly.
Hi Dawid,
This is certainly possible - what you’ll need to do is create a Table Calculation to give a new dimension that returns yes
on the row you want to show, and no
on the row you don’t want to show. If you’re trying to show the current month then that would be quite straightforward.
You can then click the cog on the column heading and select ‘Hide Nos from Visualisation’, which should get you a visualisation with only the row you’re interested in
Best,
Andy
Interesting, I did what you had suggested but I can’t see the option Hide Nos from Visualisation.
Worth checking whether you’re returning a “No” string or the actual No value that Looker returns for boolean fields.
My Calculation looks like the following:
if(${calendar_locales.month} = extract_months(now()), "Yes", "No")
I don’t know if I can cast it explicitly to boolean?
Dawid - it’s actually simpler than that!
All you need to return a yesno on a table calc is a situation that will implicitly be true or false. If you just make your table calculation as ${calendar_locales.month} = extract_months(now()) (without the if setup), records that fit that condition will receive “Yes”, and records that don’t will receive “No”. Cheers!
ooh of course it is! I knew I would try to overcomplicate it. Thanks Ben it works awesomely!
You all have nailed it— One thing to add. If you do want to cast to boolean instead of having a statement that implicitly returns true/false, you can rewrite your initial function as
if(${calendar_locales.month} = extract_months(now()), yes, no)
with no quotation marks, and it’ll evaluate to the boolean yes/no instead of a string! But,
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.