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]");
Hello Luca,
I'm not sure I understand your requirement. Do you want hierarchy of columns where you have "value1" as top level header and "date1" and "date2" as child column header? Here is what I'm talking about:
Let me know if this is your requirement.
Best regards, Martin Pavlov
Infragistics, Inc.
Yes, but I've done:
var hierarchy = dataSource.getHierarchy("[date_situation].[date_situation]"); dataSource.removeColumnItem(hierarchy); dataSource.addColumnItem(hierarchy);
using pivotgrid instead of pivotview.
Were you able to achieve what you're looking for with this code?
Best regards,
Martin Pavlov
Yes, thanks.