How do I count checked checkboxes within a query in Google sheets (this is part of a group query where I want to count checked checkboxes in column B for each value of column A grouped by column A)?
try:
=ARRAYFORMULA(QUERY({A:A\ B:B*1};
"select Col1,sum(Col2)
where Col1 is not null
group by Col1
label sum(Col2)''"))
Related
I have a set of data and I want to filter it on some conditions.
My data goes here(image1):
Similarly, I have another column that has a unique value of A column and it goes like this (image 2):
Now my problem is I am trying to filter my data(image 1) with the name matching in image 2 with one additional condition.
My filter formula works fine but only for the first name in image 2.
I am trying to get output for all the names mentioned in image2 using the Array formula. Here is my formula :
=ARRAYFORMULA(Filter(data!$A2:C,Data!$A2:A='Sheet1'!H2:H,Data!$B2:B="MATCH"))
try:
=INDEX(SPLIT(FLATTEN(QUERY(QUERY({A2:A, B2:B, C2:C},
"select max(Col3)
where Col2 = 'MATCH'
group by Col3
pivot Col1"),,9^9)), " "))
In column A there is a list of tasks.
In column B each task has an associated group.
How to, using built-in formulas, generate sequence like in column D?
Here is a screenshot :
try:
=ARRAYFORMULA(TRIM(TRANSPOSE(SPLIT(QUERY(TRANSPOSE(QUERY(QUERY(IF(A2:B="",,A2:B&"♦"),
"select max(Col1) where Col1 is not null group by Col1 pivot Col2", 0)
,,999^99)),,999^99), "♦"))))
This should work as well as player0s. I keep trying to get him to use FLATTEN() :)
=QUERY(FLATTEN(TRANSPOSE(QUERY(A2:B,"select Max(A) group by A pivot B"))),"where Col1<>''")
I have multiple sheets. I want to get the data from these sheets by a date query.
I want the Result sheet as below
try:
=QUERY({Sheet1!A3:B; Sheet2!A3:B};
"select Col1,sum(Col2)
where Col1 is not null
group by Col1
label sum(Col2)''")
I'm trying to get a pivot table, where I can select the values from something like a slicer.
I found out that using GETPIVOTDATA can get the trick with a dropdown list, but not very usefull since it's only 1 cell.
try:
=QUERY({A2:A8, INDIRECT(
ADDRESS(2, MATCH(D10, 1:1, 0))&":"&
ADDRESS(8, MATCH(D10, 1:1, 0)))},
"select Col1,sum(Col2)
where Col1 is not null
group by Col1
label sum(Col2)''", 0)
Consider following dataset that is displayed in tablix in SSRS report:
GroupID | ProductID
---------------------
Group 1 | Product1
Group 2 | Product10
Group 1 | Product2
Group 3 | Product27
Group 2 | Product12
Group 2 | Product14
I added new row via Insert Row/Outside Group - Below.
On this row I display total number of rows - achieved via CountRows(), number of distinct Groups - achieved via =CountDistinct(Fields!GroupID.Value)
I also want to display the name of the group with the most number of rows, in this case it would be "Group 2" (in case if there is more than one group with the same number of rows I only need to display one of them).
How can this be achieved? I think I should use some of aggregate or lookup functions but so far can't figure out how.
PS This report is being ported from Crystal Reports to SSRS. In Crystal Reports this is easily achieved via "Nth most frequent" summary with N=1 but there is nothing like this in SSRS as far as I can tell.
Add a tablix and set GroupId as Row Group.
For Rows Count use:
=Count(Fields!GroupID.Value)
Right click GroupID group in the Row Groups pane and go to group properties, in the Filters tab use the following settings:
For Expression use:
=Count(Fields!GroupID.Value)
It will filter the top 1 group with the greatest Rows count. The result is something like this:
UPDATE: The previous solution doesn't work if there is more than one group with the same number of occurencies.
Add a tablix, delete the details (default group) and add the GroupID field in the first column.
For the Rows Count column use the following expression replacing DataSetName by the actual name of your dataset:
=LookupSet(
Fields!GroupID.Value,
Fields!GroupID.Value,
Fields!GroupID.Value,
"DataSetName"
).Length
Right click your tablix and go to tablix properties, in the Sorting tab select Z to A order and use the previous expression in the Sort By textbox.
It should show the only one group even if a second group with same number of occurencies is present.
Let me know if this helps.