It’s easy to group data based on a specific column. You simply use groupby_col.
Original
SR. | NAME | GENDER | AGE | DATE | COUNTRY |
---|---|---|---|---|---|
1 | Dett2 | Male | 18 | 21/05/2015 | Great Britain |
2 | Nern | Female | 19 | 15/10/2017 | France |
3 | Kallsie | Male | 20 | 16/08/2016 | France |
4 | Siuau | Female | 21 | 21/05/2015 | Great Britain |
5 | Shennice | Male | 22 | 21/05/2016 | France |
6 | Chasse | Female | 23 | 15/10/2018 | France |
7 | Tommye | Male | 24 | 16/08/2017 | United States |
8 | Dorcast | Female | 25 | 21/05/2016 | United States |
9 | Angelee | Male | 26 | 21/05/2017 | Great Britain |
10 | Willoom | Female | 27 | 15/10/2019 | France |
Group by column
This example below show how grouping is done by the gender – column.
[csvtohtml_create source_type="guess" source_files="free_testdata_10rows.csv" groupby_col="3"]
SR. | NAME | GENDER | AGE | DATE | COUNTRY |
---|---|---|---|---|---|
Female | |||||
1 | Dett2 | Female | 36 | 16/08/2020 | Great Britain |
2 | Nern | Female | 19 | 15/10/2017 | France |
4 | Siuau | Female | 21 | 21/05/2015 | Great Britain |
6 | Chasse | Female | 23 | 15/10/2018 | France |
8 | Dorcast | Female | 25 | 21/05/2016 | United States |
10 | Willoom | Female | 26 | 15/10/2019 | France |
Male | |||||
3 | Kallsie | Male | 20 | 16/08/2016 | France |
5 | Shennice | Male | 22 | 21/05/2016 | France |
7 | Tommye | Male | 24 | 16/08/2017 | United States |
9 | Angelee | Male | 26 | 21/05/2017 | Great Britain |
If you don’t want to show the gender column, you can just exclude it with exclude_cols.
[csvtohtml_create source_type="guess" source_files="free_testdata_10rows.csv" groupby_col="3" exclude_cols="3"]
SR. | NAME | AGE | DATE | COUNTRY |
---|---|---|---|---|
Female | ||||
1 | Dett2 | 36 | 16/08/2020 | Great Britain |
2 | Nern | 19 | 15/10/2017 | France |
4 | Siuau | 21 | 21/05/2015 | Great Britain |
6 | Chasse | 23 | 15/10/2018 | France |
8 | Dorcast | 25 | 21/05/2016 | United States |
10 | Willoom | 26 | 15/10/2019 | France |
Male | ||||
3 | Kallsie | 20 | 16/08/2016 | France |
5 | Shennice | 22 | 21/05/2016 | France |
7 | Tommye | 24 | 16/08/2017 | United States |
9 | Angelee | 26 | 21/05/2017 | Great Britain |
If sorting is done when grouping by a column, sorting is done by column firstly but then each group is sorted invidually. This is an example where sorting is done on the name-column.
[csvtohtml_create source_type="guess" source_files="free_testdata_10rows.csv" groupby_col="3" exclude_cols="3" sort_cols="2"]
SR. | NAME | AGE | DATE | COUNTRY |
---|---|---|---|---|
Male | ||||
9 | Angelee | 26 | 21/05/2017 | Great Britain |
3 | Kallsie | 20 | 16/08/2016 | France |
5 | Shennice | 22 | 21/05/2016 | France |
7 | Tommye | 24 | 16/08/2017 | United States |
Female | ||||
6 | Chasse | 23 | 15/10/2018 | France |
1 | Dett2 | 36 | 16/08/2020 | Great Britain |
8 | Dorcast | 25 | 21/05/2016 | United States |
2 | Nern | 19 | 15/10/2017 | France |
4 | Siuau | 21 | 21/05/2015 | Great Britain |
10 | Willoom | 26 | 15/10/2019 | France |