Skip to main content

Hello!

I am currently working on visualizing a table in a dashboard, and I would like to have a final row where I can freely sum or average the values in the table. The table is updated daily and evolves over time. The [totals] argument in ods-adv-table exists, but as far as I know, it only allows summing the column values.

The only workaround we have found so far is to create a second table, removing the "group-by" per day and computing the sum/average where needed. However, this solution has a visual drawback: the legend remains, and the data in the second table is not perfectly aligned with the first one.

Do you have any other ideas to improve the visualization? I would greatly appreciate your help :) 

Here is the code with both tables created separately in case you need some more info : 

<div ods-adv-analysis="myData"
                                     ods-adv-analysis-context="eolienperiodique"
                                     ods-adv-analysis-select="AVG(ff_top_sonic_avg) as vit_moyenne, AVG(ff_top_sonic_avg)*3.6 as vit_moyenne_kmh, count(timestamp)/144*100 as disp_data, AVG(tt_99_avg) as temp_moyenne, sum(productible) as productible_moyen"
                                     ods-adv-analysis-group-by="date_format(timestamp, 'dd/MM/YYYY') as days">
                                    <ods-adv-table
                                                   data="myData"
                                                   sticky-header="true"
                                                   columns-options="{
                                                                    days: {
                                                                    label: 'Date'
                                                                    },
                                                                    vit_moyenne: {
                                                                    label: 'Vitesse moyenne  m/s]',
                                                                    decimals: 2
                                                                    },
                                                                    vit_moyenne_kmh: {
                                                                    label: 'Vitesse moyenne Âkm/h]',
                                                                    decimals: 2
                                                                    },
                                                                    disp_data: {
                                                                    label: 'Disponibilité des données %]',
                                                                    decimals: 1
                                                                    },
                                                                    temp_moyenne: {
                                                                    label: 'Température moyenne °C]',
                                                                    decimals: 1
                                                                    },
                                                                    productible_moyen: {
                                                                    label: 'Productible ekWh]',
                                                                    decimals: 0
                                                                    }
                                                                    }">
                                    </ods-adv-table>
                                    <div ods-adv-analysis="moyennedata"
                                         ods-adv-analysis-context="eolienperiodique"
                                         ods-adv-analysis-select="{{myData.length}} as jours, AVG(ff_top_sonic_avg) as vit_moyenne, AVG(ff_top_sonic_avg)*3.6 as vit_moyenne_kmh, count(timestamp)/144*100/{{myData.length}} as disp_data, AVG(tt_99_avg) as temp_moyenne, sum(productible) as productible_moyen">
                                        <ods-adv-table
                                                       data="moyennedata"
                                                       sticky-header="true"
                                                       columns-options="{
                                                                        jours: {
                                                                        label: 'Jours (total)'
                                                                        },
                                                                        vit_moyenne: {
                                                                        label: 'Vitesse moyenne  m/s]',
                                                                        decimals: 2
                                                                        },
                                                                        vit_moyenne_kmh: {
                                                                        label: 'Vitesse moyenne bkm/h]',
                                                                        decimals: 2
                                                                        },
                                                                        disp_data: {
                                                                        label: 'Disponibilité des données Â%]',
                                                                        decimals: 1
                                                                        },
                                                                        temp_moyenne: {
                                                                        label: 'Température moyenne °C]',
                                                                        decimals: 1
                                                                        },
                                                                        productible_moyen: {
                                                                        label: 'Productible total kWh]',
                                                                        decimals: 0
                                                                        }
                                                                        }">
                                        </ods-adv-table>
                                    </div>


Reply