Created
March 26, 2026 17:08
-
-
Save Medohh2120/ce02f6c5edef124df6dfce61123993fb to your computer and use it in GitHub Desktop.
Fixes GROUPBY+ HSTACK value field headers
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 characters
| /* | |
| Name: GROUPBY_RETITLE | |
| Description: Replaces the native (GROUPBY+HSTACK) value field headers with provided [custom_headers] array. | |
| GROUPBY.[Field_headers] must equal 2 or 3. | |
| Made By: Medohh2120 | |
| */ | |
| GROUPBY_RETITLE = LAMBDA(groupby_result, [custom_headers], | |
| LET( | |
| n_value_fields, SUM(--(TAKE(groupby_result, 1) <> "")), | |
| n_row_fields, COLUMNS(groupby_result) - n_value_fields, | |
| row_fields_fields, DROP(TAKE(groupby_result, , n_row_fields), 1), | |
| default_headers, TAKE(groupby_result, 1, -n_value_fields), | |
| grid, DROP(groupby_result, 2, n_row_fields), | |
| IF( | |
| ISOMITTED(custom_headers), | |
| HSTACK(row_fields_fields, VSTACK(default_headers, grid)), | |
| HSTACK(row_fields_fields, VSTACK(custom_headers, grid)) | |
| ) | |
| ) | |
| ); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
GROUPBY.[Field_headers] = 3
GROUPBY.[Field_headers] = 2