Hi All,
Iโve noted that in charts - Histogram, only one colour is applied to all the bars. Is there a way to apply different colours to different bars on it?
Thanks.
When values are coming from the same column, you can use only one color.
@Aleksi_Alkio Thank you. If I wanted responses from a single column to be displayed in multiple colours, I guess, I have to get those responses broken down in to different virtual columns isnโt it? For example, I have a โphysicalโ column of Enum type called โType of liver resectionโ, and its options for the user are โTrisectionectomyโ, โHemi hepatectomyโ, โSectionectomyโ, โSegmentectomyโ, โNon-anatomical resectionโ. For each row in the spreadsheet (=each patient), user can select only one. So the gSheetโs โType of liver resectionโ column shows 3 trisectionectomies, 4 hemi hepatectomies, 2 sectionectomies, 9 segmentectomies, 10 non-anatomical resections so far recorded. What I want is to create a chart that shows these values with different colours. So I created a virtual column for each of these, as in, if the โType of liver resectionโ = โtrisectionectomyโ, the number type VC [Trisectionectomy_Count] would record โ1โ value in it. So I thought I could eventually write a SUM expression to calculate the โTrisectionectomy_Countโ. So for the 5 different responses I created 5 virtual columns to record a value of โ1โ everytime a user selects the relevant option. And then I created 5 more virtual columns to SUM each of them. But the SUM(LIST([Trisectionectomy_Count])) didnโt return the SUM of Trisectionectomies. All it does is, return a value of 1 only if I select โTrisectionectomyโ as the option, as if itโs not summing up all the 1โs in the virtual column [Trisectionectomy_Count]. Could you help me out?
The reason SUM(LIST([Trisectionectomy_Count])) doesnโt work is because [Trisectionectomy_Count] refers to the Trisectionectomy_Count column value of the current row only. You then put that one value into a list and summed the single value in the list.
To get a list consisting all of a columnโs values, include the table name in front of the column reference, as in: Patient Info[Trisectionectomy_Count]. Because this produces a list, you donโt need to (and in fact should not) wrap it with LIST(). It can go directly into SUM():
SUM(Patient Info[Trisectionectomy_Count])
This will return the sum of all values in the Trisectionectomy_Count column of the Patient Info table.
+Steve Coile Thank you very much! It worked!
User | Count |
---|---|
41 | |
36 | |
28 | |
23 | |
16 |