Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
70
igPivotView add column
posted

Hi,

I have a pivot view with these measures:

Value1,Value2,Value3.....

I'd like to have

Value1*************Value2*************Value3

Date1**Date2***Date1**Date2*****Date1**Date2

But when I set the date in the column, it give me date before measures. I'm trying to add date column programmatically, but it doesn't work.

This is the code:

dataSourceOptions: {
            rows: '[id_indexPar].[id_indexPar]',
            measures: '[Measures].[value1],[Measures].[value2],[Measures].[value3],[Measures].[value4],[Measures].[value5]',
            columns: '[date_situation].[date_situation]',
            flatDataOptions: {
            metadata: {
                        cube: {
                        name: 'CuboSens',
                        caption: 'CuboSens',
                        measuresDimension: {
                                caption: 'Misure',
                                measures: [
                                    { name: 'value1', caption: 'value1', aggregator: sumAggregator('value1') },
                                    { name: 'value2', caption: 'value2', aggregator: sumAggregator('value2') },
                                    { name: 'value3', caption: 'value3', aggregator: sumAggregator('value3') },
                                    { name: 'value4', caption: 'value4', aggregator: sumAggregator('value4') },
                                    { name: 'value5', caption: 'value5', aggregator: sumAggregator('value5') },
                                    { name: 'date_situation', caption: 'date_situation', aggregator: sumAggregator('value5') },
                                ]
                        },
                            dimensions: [
                                { name: 'date_situation', caption: 'date_situation', hierarchies: [{ name: 'date_situation', caption: 'date_situation', levels: [{ name: 'date_situation', caption: 'date_situation', memberProvider: function (item) { return item.date_situation; } }] }] },
                                { name: 'id_indexPar', caption: 'id_indexPar', hierarchies: [{ name: 'id_indexPar', caption: 'id_indexPar', levels: [{ name: 'id_indexPar', caption: 'id_indexPar', memberProvider: function (item) { return item.id_indexPar; } }] }] },
                            ]
                        }
            },
                dataSource:dt,
                dataSourceType: "json",
                }
    }

$("#grdDettagliPR_EVE").igPivotView("option", "dataSource").addColumnItem("[date_situation].[date_situation]");