Author Topic: Column Group Title Rename in Pivot  (Read 2241 times)

EPM Solutions

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 182
    • View Profile
Column Group Title Rename in Pivot
« on: October 01, 2018, 12:43:22 pm »
Hello Team,

Is it possible to remove Extra added text (based on the aggregation) on column title for particular column. please let me know the solution, as shown in the below image ,  here I need Only Forcast To complete Instead of sum(Forcast to complete) as column title. Bu t functionality should remain same.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Column Group Title Rename in Pivot
« Reply #1 on: October 01, 2018, 01:26:35 pm »
Yes it's possible to customize colModel ( which includes modify title of some of the columns ) generated during pivoting.

It's documented in these examples:

https://paramquery.com/pro/demos/pivot_custom

https://paramquery.com/pro/demos/pivot_total
« Last Edit: October 01, 2018, 01:32:38 pm by paramquery »

EPM Solutions

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 182
    • View Profile
Re: Column Group Title Rename in Pivot
« Reply #2 on: October 01, 2018, 02:47:55 pm »
Yes, But here I need it like, it should come under the month 3 column should come and 3rd one(Sum Total) should be total. other Two column should be like as it is.  As shown in the image

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Column Group Title Rename in Pivot
« Reply #3 on: October 01, 2018, 10:26:27 pm »
You have to recurse through colModel in pivotCM event ( as shown in previous links ) and remove aggregate name from the titles.

Code: [Select]
col.title = col.title.replace(/\S+\((.*)\)/, "$1")

If you are still facing difficulties, please share a jsfiddle/ plnkr.

EPM Solutions

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 182
    • View Profile
Re: Column Group Title Rename in Pivot
« Reply #4 on: October 03, 2018, 08:05:52 pm »
Thank you , I got IT.