could you help me with this same loggic as you explained but cannot find a fix to this query it is basically add all total_calls by name. when you select in time picker for one day 2 days or last 7 days so on....
I want to get total_calls per day and show in a graph for 30 days.
cdr_events
(callingPartySubgroup="$selectgroup$" OR originalCalledPartySubgroup="$selectgroup$" OR finalCalledPartySubgroup="$selectgroup$") dest_device_type="hardphone" OR orig_device_type="hardphone" duration>0
| eval number=mvappend(if(callingPartySubgroup="$selectgroup$",callingPartyNumber,null()), if(originalCalledPartySubgroup="$selectgroup$", originalCalledPartyNumber,null()), if (finalCalledPartySubgroup="$selectgroup$", finalCalledPartyNumber, null()))
| mvexpand number
| search number=*
| fillnull callMediaType value="unknown"
| eventstats dc(callId) as calls sum(duration) as seconds by number callMediaType
| eval number_media_calls_seconds=number + "::" + callMediaType + "::" + calls + "::" + seconds
| get_call_concurrency(number_media_calls_seconds)
| timechart_for_concurrency(number_media_calls_seconds,50000)
| eval day_of_week =strftime(_time,"%a")
| eval hour_of_day=strftime(_time,"%H")
| eval is_business_hours=case((day_of_week=="Sat" OR day_of_week=="Sun"),0,(hour_of_day>7 AND hour_of_day<17),1,true(),0)
| search is_business_hours=1
| fields - day_of_week hour_of_day is_business_hours
| untable _time number_media_calls_seconds active
| eval number_media_calls_seconds=split(number_media_calls_seconds,"::")
| eval number=mvindex(number_media_calls_seconds,0)
| eval media=mvindex(number_media_calls_seconds,1)
| eval calls=mvindex(number_media_calls_seconds,2)
| eval seconds=mvindex(number_media_calls_seconds,3)
| eval minutes=round(seconds/60,2)
| eval {media}_minutes=minutes
| eval {media}_calls = calls
| eval active=if(active>0,1,active)
| stats values(video_calls) as video_calls values(audio_calls) as audio_calls values(audio_minutes) as audio_minutes values(video_minutes) as video_minutes count(eval(active=1)) as active count(eval(active=0)) as inactive by number
|fillnull audio_minutes, video_minutes, audio_calls, video_calls value="0" | eval total_calls=audio_calls+video_calls
| eval total_minutes=audio_minutes+video_minutes
| eval utilization=round(100*active/(active+inactive),2)
| lookup groups number OUTPUT name group subgroup |search number!=OTHER | fields name number group subgroup audio_minutes video_minutes total_minutes audio_calls video_calls total_calls utilization
|fields - number group subgroup audio_minutes video_minutes audio_calls video_calls
... View more