How to add a column in Group By field of reporting?

rezacol
Mega Expert

Hi Guys,

 

I have a query on how to add some column which are not present in the Group By field on the reporting form for that particular table.

 

Quick help will be much appreciated.

 

Thanks,

Reza

1 ACCEPTED SOLUTION

Mike Moody
Kilo Guru

Hi Reza,



I was able to solve this problem by using the following procedure.


  1. Open the report via the Edit link in the left-nav, export the report to XML.
  2. Edit the <filter> tag in the XML to have the GROUPBY statement target the field name you want.
  3. Save and Import the modified XML file back into the system.

Just keep in mind that if you change this report in the future you will have to repeat this process because the Group By field will be overwritten with the value none.



Example: (I targeted the url field here, which is a field that isn't available to Group By on the syslog_transaction table)


<filter table="syslog_transaction">sys_created_onONToday@javascript:gs.daysAgoStart(0)@javascript:gs.daysAgoEnd(0)^sql_count&gt;0^sys_created_by!=guest^urlSTARTSWITH/u_analytics.do^EQ^GROUPBYurl  



Regards,



Michael Moody


Software Engineer


Milestone Technologies, Inc.






View solution in original post

21 REPLIES 21

harikrish_v
Mega Guru

Hi Reza,



You can right click on any field in the list layout and do a Group By on that. If you need to Group By a field that needs to be added via reference field then personalize the list layout, use dot walking to add this field, once its added to the list layout, right click on it and do Group By.



Thanks & regards,


Hari


Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Reza,



Can you please explain the requirement in detail so that we can come up with the exact solution.



Thanks,


Pradeep


rezacol
Mega Expert

Harikrishnan Vijayan I am talking about the Group By field which is present in the Reports. I am having issue with some fields which are not available in the list of Group By list.. however it is there in my table.



pradeep Sharma My requirement is to create a report having a group by on some filed. For example, say I need to create a report on how many incident are created and assigned to different groups. So here I can add in the query having Group By as Assignment group. However, there are some custom fields which are not available in the Group By List in the report form.



Let me know if you have any solution on how to make that field visible in Group By dropdown list.



Thanks in Advance,


Reza


Ok,so these fields in your table that are missing in the Group By field, they might have been added to the form using dot walking(ie via a reference field on your form). In the dropdown, click on the last blue entry called Show Related Fields-> the dropdown will show all the reference fields on your form in blue color->click on any to expand it and see the fields belonging to the table it is referring, Mostly you will find your field there. Read this wiki links on more details on dot walking:-


Dot-Walking - ServiceNow Wiki



Thanks & regards,


Hari