select srrm.workorderid AS "Ticket Number",aau.FIRST_NAME as "Requester Name",srm.RESULT as "satisfaction level",sd.FIRST_NAME as "Technician Name" from SurveyResponseRequestMapping srrm
select srrm.workorderid AS "Ticket Number",srm.RESULT as "satisfaction level (%)", aau.FIRST_NAME as "Requester Name",sd.FIRST_NAME as "Technician Name",longtodate(srm.RESPONSETIME) as "Survey Responded time", "ad"."ORG_NAME" AS "Account" from SurveyResponseRequestMapping srrm
left join Survey_Response_Main srm ON srrm.RESPONSEID=srm.RESPONSEID LEFT JOIN AaaUser aau ON srm.USERID=aau.USER_ID left join WorkOrderStates wos ON srrm.WORKORDERID=wos.WORKORDERID left join WorkOrder wo ON srrm.WORKORDERID=wo.WORKORDERID LEFT JOIN AaaUser sd ON wos.OWNERID=sd.USER_ID
Left join AccountSiteMapping asm ON wo.SITEID=asm.SITEID Left JOIN AccountDefinition ad ON asm.ACCOUNTID=ad.ORG_ID where srm.RESULT IS NOT NULL AND
srm.RESPONSETIME >= datetolong('2021-04-20') AND srm.RESPONSETIME <= datetolong('2021-04-23')
With Survey comments:
select srrm.workorderid AS "Ticket Number",srm.RESULT as "satisfaction level (%)", srcmt.COMMENTTEXT AS "Comments", aau.FIRST_NAME as "Requester Name",sd.FIRST_NAME as "Technician Name",longtodate(srm.RESPONSETIME) as "Survey Given date", ad.ORG_NAME AS "Requester Company" from SurveyResponseRequestMapping srrm
left join Survey_Response_Main srm ON srrm.RESPONSEID=srm.RESPONSEID LEFT JOIN Survey_Response_Comment srcmt ON srm.RESPONSEID=srcmt.RESPONSEID LEFT JOIN AaaUser aau ON srm.USERID=aau.USER_ID left join WorkOrderStates wos ON srrm.WORKORDERID=wos.WORKORDERID left join WorkOrder wo ON srrm.WORKORDERID=wo.WORKORDERID LEFT JOIN AaaUser sd ON wos.OWNERID=sd.USER_ID
Left join AccountSiteMapping asm ON wo.SITEID=asm.SITEID Left JOIN AccountDefinition ad ON asm.ACCOUNTID=ad.ORG_ID where srm.RESULT IS NOT NULL AND srm.RESPONSETIME >= datetolong('2021-01-20') AND srm.RESPONSETIME <= datetolong('2021-05-23')
PS : Add criteria for dates and other under where condition
NOTE: Date filter highlighted in the query can be modified and below parameters can be used instead.
How to compare date column with auto filled date templates?
- Here is the example for getting this week data - CREATEDTIME >= <from_thisweek> AND CREATEDTIME <= <to_thisweek>
- <from_thisweek> - Starting date of this week
- <to_thisweek> - Ending date of this week
- Available Date Templates
- Today - <from_today> - <to_today>
- This week - <from_thisweek> - <to_thisweek>
- Last week - <from_lastweek> - <to_lastweek>
- This month - <from_thismonth> - <to_thismonth>
- Last month - <from_lastmonth> - <to_lastmonth>
- This quarter - <from_thisquarter> - <to_thisquarter>
- Last quarter - <from_lastquarter> - <to_lastquarter>
- Yesterday - <from_yesterday> - <to_yesterday>