ag-grid prevent expanding grouped data - ag-grid

I am using ag grid enterprise with grouping.
Is it possible to group data but based on first column but prevent expanding the row? I just want to display the sums.
I am using this data : https://raw.githubusercontent.com/ag-grid/ag-grid/master/grid-packages/ag-grid-docs/src/sample-data/rowData.json
Please check the code here: https://codesandbox.io/s/nice-varahamihira-1r8bf?file=/src/App.js
As you can see in the image, I just want to display the total sum of prices of Toyota, Ford etc, but I do not want the users to expand them.

If you do not need the children, why you need a tree view for it?
You should do this logic in component and only pass the sums data to the grid.

Related

How to add data to the grouped row in AgGrid's grid

When using Row Grouping in AgGrid, how one can add data to the grouped row as follows:
The result is not an aggregate, actually it should be another value from the group itself, I can use the master detail to achieve that but I couldn't find an easy way of changing the details grid to look like the grouped one.

Tableau | Display different sheets by selecting option(s) from one particular filter

Is there a way to display different sheets by clicking/selecting values/options from one particular filter?
for example, if I have this filter:
and I need to display a sheet named Departments when I select Commercial from the filter shown in the PtrScn.
However, When I click/select any other options like HR, Information ...etc, I want it to display the associated sheet with the filter "Filter by Sector"
Any hints would be highly appreciated!
NOTE: I use tableau 2019.1 and it does not show "Change Parameter" that might be needed to approach this as I noticed when I have been researching for two days now!
You should use a container (say vertical) where you wanna put your N worksheets one on top of the other one without changing vertical spacing: just let Tableau do its stuff!
Be sure to remove the worksheet titles.
Once you're done, you need to create a parameter in order to handle all the N possible choices, and according to that you need to create N Calculated fields with a condition like this one:
if [Param] = 'Profit' then 'ok' else 'ko' end
Each calculated field will be used as a condition (select just ok values) in your filter selection.
Since the parameter can accept just one value a time, you will have just one of your N worksheet displaying data.
And this is the trick based on the vertical conatiner: if you hide worksheet titles, you will see "something" just for the selected worksheet and Tableau automatically will handle all the vertical space in the container.
The result will look like the following:
Adding to Fabio's great answer, these resources about collapsing containers may be useful:
Sheet swapping using collapsing containers
Automatically resize items in a Tableau container (or make disappear in your case)

How to have 'Pivot Row Totals' in server-side rendering ag-grid pivot mode

I use ag-grid enterprise edition and I would to add total columns in pivot mode. It is very clear in document how to do so but not in server-side rendering. The idea is that the back-end calculate the total of values for each row and I want to show it in the grid.
I tried a workaround using custom row groups and adding new columns to columnDef to describe the total columns, but it's not showing in the grid, because the total is not a row group. I can't find in the API a method to add a column that is not a Value column or a Pivot column in the ag-grid in pivot mode.
I want to know is someone find a way to do it in this context.
Nevermind, I find how to do it. You just have to push the columns you want as total using gridColumnApi.setSecondaryColumns. It's important to be aware of the colId and field to match the key of your row data corresponding.

Group by first two characters of column, in Tableau?

I'm using Tableau Desktop v9.0. I have data that looks like this:
code,items
02050252,7
03040620,19
03060423,3
I want to create a bar chart of the items grouped by the first two characters of the code field.
So effectively a chart that shows this underlying data:
new_code,items
02,7
03,22
Is it possible to do this within Tableau? Or do I need to group the data manually myself first?
You can definitely do this within Tableau.
Make sure that your code column is a string. If it's not, right click on it in the dimensions section and choose Change Data Type.
Then, create a calculated field (Analysis -> Create Calculated Field) and enter the expression LEFT([Code], 2), which will take the first two characters of the code field.
Drag your new_code field to the Rows shelf and Items to the Columns shelf and voila, you have your desired data. You can of course change the type of the chart, make it a table, etc. from here.

How to list multiple rows within Table component specific column?

I have Table and I want to display multiple row in same band like the below image
I have tried with by Adding frame inside the table column and using list component to list multiple rows but it wont works.
like the following hierarchy
Table-->Detail band-->Column-->Frame-->list component-->TextField
Can any one help me How to Solve this ? thanks in advance
There are two ways of doing it.
Way 1:
Put a sub report into last column. Pass the data to it. This way there would be multiple fields in it.
Way 2:
Use groups and custom styles along with groups(styles and groups will have to manages logically).
I think you should go for way 1 if the data in your last column does not span more than one page. Otherwise way 2 is applicable.