Last active
December 24, 2023 09:31
-
-
Save Weiyuan-Lane/4727e6dea9626c51c4f269df822edffd to your computer and use it in GitHub Desktop.
Revisions
-
Weiyuan-Lane revised this gist
Dec 24, 2023 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -25,6 +25,7 @@ LABEL #### L2 - Perform a `SELECT` query on column A's data, with a `COUNT` column - `WHERE` is also used to conditionally filter away empty content and content that you don't want to count - `GROUP BY`, `COUNT` and `ORDER BY` can be used to emulate functionalities like sorting #### L11 - `LABEL COUNT(A)''` simply omits setting a label for the output count column by using the `''` empty string -
Weiyuan-Lane revised this gist
Dec 24, 2023 . 1 changed file with 17 additions and 17 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,19 +1,3 @@ ``` =QUERY(A2:A, " SELECT @@ -28,4 +12,20 @@ ORDER BY LABEL COUNT(A)'' ") ``` ## Explanation #### L1 - Using the [QUERY Function](https://support.google.com/docs/answer/3093343?hl=en) of Google Sheets - The column or row of cells should be in your first parameter of this function - `A2:A` is my column to sample the content from, starting from row 2 of column A to the last value - Replace `A` to the desired column value that you are referencing #### L2 - Perform a `SELECT` query on column A's data, with a `COUNT` column - `WHERE` is also used to conditionally filter away empty content and content that you don't want to count #### L11 - `LABEL COUNT(A)''` simply omits setting a label for the output count column by using the `''` empty string - Try omitting it to see what happens -
Weiyuan-Lane revised this gist
Dec 24, 2023 . 2 changed files with 31 additions and 13 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ ## Explanation #### L1 - Using the [QUERY Function](https://support.google.com/docs/answer/3093343?hl=en) of Google Sheets - The column or row of cells should be in your first parameter of this function - `A2:A` is my column to sample the content from, starting from row 2 of column A to the last value - Replace `A` to the desired column value that you are referencing #### L2 - Perform a `SELECT` query on column A's data, with a `COUNT` column - `WHERE` is also used to conditionally filter away empty content and content that you don't want to count #### L11 - `LABEL COUNT(A)''` simply omits setting a label for the output count column by using the `''` empty string - Try omitting it to see what happens ``` =QUERY(A2:A, " SELECT A, COUNT(A) WHERE A IS NOT NULL AND A != 'Others (Custom)' GROUP BY A ORDER BY COUNT(A) DESC LABEL COUNT(A)'' ") ``` This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,13 +0,0 @@ -
Weiyuan-Lane created this gist
Dec 24, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ =QUERY('All #TechWalks'!D2:D, " SELECT D, COUNT(D) WHERE D IS NOT NULL AND D != 'Others (Custom)' GROUP BY D ORDER BY COUNT(D) DESC LABEL COUNT(D)'' ")