Hi GD team, i was wondering if there’s a way to ge...
# gd-beginners
m
Hi GD team, i was wondering if there’s a way to get a total by column? I was trying to create a metric that will sum up all the apples in 2022 with attribute 1, but when i add it, the sum still goes down below all the attributes at the column level. any hints? thanks much in advance!
here’s where i’m stuck atm🫠
j
Hello Masha, Could you please provide more information here as we are not familiar with your data well enough? What exactly represents “0” and “1" in this case and how does your current metric look like? Do I understand correctly that you want SUM of all columns of Apples where value is “1”?
m
sorry, 0 or 1 are just values of an attribute applied to the fact ‘apples’. so basically i struggle with summing up fact values for 2022 as one number at the end of the row. ideally i also want this sum to disregard date by month attribute but filter out 0/1 attribute only by value 1). but total by row will already be helpful:)
my current metric (
Apples 1 by year
) looks like this
SELECT SUM(*Apples*) BY ALL *Year (Date)* WHERE *Attribute* = *1*
j
Unfortunately, I don’t see a way how to go about this using columns as the metric will be visually always split by the attribute in the Insight layout. You could possibly achieve something similar while using rows, with the pre-built SUM function. However, you would need to filter out the particular attribute (“1” in your case). That way the SUM metric would appear in separated row.
If you plan to use this insight on a dashboard, another common approach would be to use separated insight to display only the Apple SUM for the particular attribute and visualise it on the same dashboard.
m
got it, thank you!