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

Fetch aggregate wrong sum result for money field values

$
0
0

Hi everybody.

I´m working on a report for Dynamics 365 Online, and I´m using a dataset that uses aggregate to sum the priceperunit field in quotedetail entity.

The fetch XML without aggregate is:

<fetch>
<entity name="quotedetail" >
<attribute name="itx_nombreagrupador" alias="Agrupador" />
<attribute name="priceperunit" />
<attribute name="itx_cargoactivacionlocal" />
<filter type="and" >
<condition attribute="quoteid" operator="eq" value="5BE8EB06-D0AD-E711-8101-E0071B6F9031" />
<condition attribute="itx_contratoid" operator="eq" value="95F0B95B-119F-E711-8116-C4346BB64010" />
<condition attribute="itx_companiaitxid" operator="eq" value="49DC10D4-CE98-E711-8109-C4346BB53E2C" />
<condition attribute="itx_empaquetaralprincipal" operator="eq" value="1" />
</filter>
</entity>
</fetch>

And the result for this firts Fecth is:

 INTERNEXA IP ACCESS NG - BZM0Q    70000,0000   Peso Colombiano
 INTERNEXA IP ACCESS NG - BZM0Q    50000,0000   Peso Colombiano

Second column is the priceperunit, and the sum result must be 120000,0000

 The fetch XML with aggregate is:

<fetch aggregate="true" >

  <entity name="quotedetail" >

    <attribute name="itx_nombreagrupador" alias="Agrupador" groupby="true" />

    <attribute name="priceperunit" alias="sum_price" aggregate="sum" />

    <filter type="and" >

      <condition attribute="quoteid" operator="eq" value="5BE8EB06-D0AD-E711-8101-E0071B6F9031" />

      <condition attribute="itx_contratoid" operator="eq" value="95F0B95B-119F-E711-8116-C4346BB64010" />

      <condition attribute="itx_companiaitxid" operator="eq" value="49DC10D4-CE98-E711-8109-C4346BB53E2C" />

      <condition attribute="itx_empaquetaralprincipal" operator="eq" value="1" />

    </filter>

  </entity>

</fetch>

Grouping  by the first column, the result is:

INTERNEXA IP ACCESS NG - BZM0Q   119980,126500000

The result is missing like 20 money units. I understand small differences with some decimals, but 20 units?

Do you know what´s wrong? How can I get the exact result? 

Thanks in advance for your help.

Juan Pablo.

 

 INTERNEXA IP ACCESS NG - BZM0Q70000,000070000,0000000000fe0a63a0-7faa-e611-80e7-c4346bb53e2c
 INTERNEXA IP ACCESS NG - BZM0Q50000,000050000,0000000000fe0a63a0-7faa-e611-80e7-c4346bb53e2c

Viewing all articles
Browse latest Browse all 82002

Latest Images

Trending Articles



Latest Images