Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 79901

FetchXML and SUM incidentresolution

$
0
0

Hi All,

I have a question.How I can SUM incidentresolutions but only this last modified?

I have problem with SUM amount of all time spent (resolve cases) for customers. I create report with this Query:

<fetchversion="1.0"output-format="xml-platform"mapping="logical"distinct="false">
<entityname="incident">
<attribute
name="title"/>
<attribute
name="ticketnumber"/>
<attribute
name="createdon"/>
<attribute
name="incidentid"/>
<attribute
name="title"/>
<attribute
name="prioritycode"/>
<attribute
name="customerid"/>
<attribute
name="contractid"/>
 
<attributename="modifiedon"/>
<attributename="new_forma"/>
<attributename="new_czasrealizacji"/>
 <attributename="statecode"/>
<attributename="new_adresemailzglaszajacego"/>
 <orderattribute="title"descending="false"/>
 <filtertype="and">
<condition
attribute="createdon"operator="on-or-after"value="@Miesiac_create"/>
<condition
attribute="modifiedon"operator="on-or-before"value="@Miesiac_modifie"/>
 
</filter>
 <link-entityname="contractdetail"from="contractdetailid"to="contractdetailid"visible="false"link-type="outer"alias="kontrakt_pozycje">
<attribute
name="totalallotments"/>
<attribute
name="allotmentsused"/>
<attribute
name="allotmentsremaining"/>
 
</link-entity>
 
<link-entityname="contract"from="contractid"to="contractid"visible="false"link-type="outer"alias="kontrakt">
<attributename="totalprice"/>
 <attributename="expireson"/>
 <attributename="customerid"/>
 <attributename="activeon"/>
 </link-entity>
 
<link-entityname="incidentresolution"from="incidentid"to="incidentid"visible="false"link-type="outer"alias="obsluga_sprawy">
 <filtertype="and">
 <conditionattribute="statecode"operator="eq"value="1"/>
 </filter>
<attribute
name="timespent"/>
<attributename="description"/>
 </link-entity>
 <link-entityname="task"from="regardingobjectid"to="incidentid"link-type="outer"alias="zadanie">
<filter
type="and">
<condition
attribute="activitytypecode"operator="eq"value="4212"/>
</filter>

<attributename="subject"/>
<attributename="actualdurationminutes"/>
 <attributename="regardingobjectid"/>
<attribute
name="new_numerpru"/>
<attributename="new_datawykonaniazadania"/>
 <attributename="description"/>
 
<attributename="createdon"/>
</link-entity>
 </entity>
 </fetch>

Before I add this filter:

<filtertype="and"><conditionattribute="statecode"operator="eq"value="1"/></filter>

Any reopen case and close cause a double value of time spent. If I reopen case where time spent was 1 hour and close - on a reports there was a double value - 2 hours.

This condition attribute resolve a part of problem.

This two cases have SUM time spent = 90 min. On report is 150 min.

First have one task = 30 min, second have two tasks - each of them = 30 min.

This SUM field Expression: =Sum(Fields!obsluga_sprawy_timespentValue.Value)

Any suggest?

I notice that this report SUM twice. He sums 1st task = 30 min, 2nd task = 30 min, 3rd task = 30 min and incidentresolution value has been added.

How I can SUM only last incidentresolution value?

In my post:

http://social.microsoft.com/Forums/en-US/crm/thread/a427caa7-89a4-4a73-8205-885ac176afeb


Viewing all articles
Browse latest Browse all 79901

Trending Articles