ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: queensgambit9 on September 24, 2018, 02:20:29 pm
-
When having rows with certain values with multidimension structure...would it be possible to group by those values?
How to handle aggregated data since fact only should be counted once?
-
it can be done by adding a formula column to extract primitive values and use this column for grouping.
-
Hmm...got a short example? Not sure how to implement it.
The values are in the response from DB (multiple rows with different group but same fact)...
-
There are already couple of examples on formula columns https://paramquery.com/pro/demos/grid_formula
and row grouping https://paramquery.com/pro/demos/group_rows
I can help you with more relevant example if share the structure of your rows with certain values with multidimension structure....
-
Thanks.
Example:
type category id value
-----------------------------
test cat 1 1 10
test cat 2 1 10
test cat 2 2 30
Grouping on "type" with SUM will give "test SUM 50", correct in my case should be 40 since row with "id" 1 occurs multiple times...
-
Thanks for the example.
It can be solved in paramquery spreadsheet by use of this formula
=IF(COUNTIF($A$1:A1,A1)=1,B1,"")
https://superuser.com/questions/132700/excel-sum-that-excludes-duplicates
But Excel formulas can't be used in the place of row grouping aggregates and js formulas can't cross reference other rows, so I don't see any way to do it in case of row grouping.