Author Topic: Pivot Issues  (Read 78 times)

EPM Solutions

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 136
    • View Profile
Pivot Issues
« on: April 11, 2019, 12:36:00 pm »
Hello,

       1) Can you tell me that why all column are showing in aggregation while I am applying only on two column(as in screenshot and plunker)? In Screenshot I have highlighted the unwanted column. I am also providing the code of my groupModel.

2) If I am removing the summary.type then why it is not showing the summary total or row total in grid in normal mode?

Please provide a solution
Plunker url:
https://next.plnkr.co/edit/Ct7jrEcYWOqkY8cT

paramquery

  • Administrator
  • Hero Member
  • *****
  • Posts: 3861
    • View Profile
Re: Pivot Issues
« Reply #1 on: April 11, 2019, 05:35:13 pm »
Please remove column.summary.type from all unwanted columns except proBudget & proOverUnder

https://next.plnkr.co/edit/uhUlcokYBsGT2SeS

EPM Solutions

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 136
    • View Profile
Re: Pivot Issues
« Reply #2 on: April 11, 2019, 05:43:53 pm »
Hello Team,

Thanks for your quick reply.

But after removing summary.type we are no longer to see Summary in Title row.

Our requirement is we need to show Total Summary in Title row and in the Pivot mode we need only 2 columns in Aggregation Panel.

Please give your feedback asap.
« Last Edit: April 11, 2019, 05:46:15 pm by pankajs »

paramquery

  • Administrator
  • Hero Member
  • *****
  • Posts: 3861
    • View Profile
Re: Pivot Issues
« Reply #3 on: April 11, 2019, 09:33:17 pm »
Please confirm your requirements:

You want to apply aggregates to all columns in row grouping mode while apply aggregates to only 2 columns in pivot mode.

Quote
If I am removing the summary.type then why it is not showing the summary total or row total in grid in normal mode?

Please define normal mode.
« Last Edit: April 11, 2019, 09:38:10 pm by paramquery »

EPM Solutions

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 136
    • View Profile
Re: Pivot Issues
« Reply #4 on: April 12, 2019, 08:15:06 am »
Hello Team,

Normal Mode = Without Pivot Mode

If we remove summay.title from column in normal mode it stop showing Summary in Group Row Title.

Please check attached Image.

Plunker:
https://next.plnkr.co/edit/k3gYbolblYFomTMn

Our Requirtment:
1. We want to show summary for all columns in Group Row Title in Normal Mode.

2. And when we change Normal Mode to Pivot Mode we want to show only 2 columns in aggregation.


Please check above details and let us know if you require any further information.
« Last Edit: April 12, 2019, 09:08:12 am by pankajs »

paramquery

  • Administrator
  • Hero Member
  • *****
  • Posts: 3861
    • View Profile
Re: Pivot Issues
« Reply #5 on: April 12, 2019, 07:26:15 pm »
you can use groupOption event to switch between 2 column aggregates and all column aggregates.

Code: [Select]
groupOption: function(evt, ui){
        var newPivot = this.option('groupModel.pivot');
       
        //pivot turned on
        if( newPivot && !ui.oldGM.pivot ){
          this.getColModel().forEach(function(col){
            if(col.dataIndx != "proBudget" && col.dataIndx != 'proOverUnder' ){
              col.summary = null;
            }
          })
        }
        //pivot turned off
        else if( !newPivot && ui.oldGM.pivot ){
            this.getColModel().forEach(function(col){
              col.summary = {type:'all'};
            })
        }
        //debugger;
      },

EPM Solutions

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 136
    • View Profile
Re: Pivot Issues
« Reply #6 on: April 15, 2019, 11:55:40 am »
Hello Team,

                Thank you for your reply.

                We applied the above code but still it is showing the other columns(like Original Budget,Budget Adjustments etc) in aggregates with projected budget and Projected Over/Under. Is it not possible to hide the columns from aggregates without removing the summary.type ?

Second point is, when we are changing the summaryOption by clicking on the sum of projected Budget in Aggregates of tool Panel then aggregation applies on other columns that is not correct. Please give the solution in a plunker and let me know if any query regarding the above points.

Plunker:
https://next.plnkr.co/edit/Ct7jrEcYWOqkY8cT

« Last Edit: April 15, 2019, 12:05:24 pm by EPM Solutions »

EPM Solutions

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 136
    • View Profile
Re: Pivot Issues
« Reply #7 on: April 16, 2019, 10:09:45 am »
Hello Team,

                After updating your code, aggregation is showing only on two columns (proBudget & proOverUnder) but still other columns are also showing in aggregate in Tool Panel. Please provide a solution to put only two columns in aggregates as used in group Model(proBudget & proOverUnder).
« Last Edit: April 16, 2019, 10:11:24 am by EPM Solutions »

paramquery

  • Administrator
  • Hero Member
  • *****
  • Posts: 3861
    • View Profile
Re: Pivot Issues
« Reply #8 on: April 16, 2019, 11:51:50 am »
It's to be expected that whatever columns have summary property defined would show up in aggregates pane in tool Panel.

However if you want to hide them, then please add tpHide: true to the columns as answered in one of the previous posts.

https://paramquery.com/pro/api#option-column-tpHide