聚合似乎与VersionOne RESTful API中的数据不匹配 [英] Aggregation doesn't seem to match data in the VersionOne RESTful API

查看:116
本文介绍了聚合似乎与VersionOne RESTful API中的数据不匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

鉴于此查询(为了便于阅读而添加间距):

Given this query (spacing added for readability):

rest-1.v1\Data\Story?
    sel=
        Children.ID,
        Children.Actuals.Value,
        Children:Task.@Count,
        Children.Actuals.Value.@Sum.Value
    &where=Number='B-02833'

我收到以下回复:

<Assets total="1" pageSize="2147483647" pageStart="0">
    <Asset href="/rest-1.v1/Data/Story/13195" id="Story:13195">
        <Relation name="Children.ID">
            <Asset href="/rest-1.v1/Data/Task/34505" idref="Task:34505"/>
            <Asset href="/rest-1.v1/Data/Task/34506" idref="Task:34506"/>
            <Asset href="/rest-1.v1/Data/Task/34507" idref="Task:34507"/>
        </Relation>
        <Attribute name="Children.Actuals.Value.@Sum">97.2</Attribute>
        <Attribute name="Children.Actuals.Value">
            <Value>1</Value>
            <Value>2</Value>
        </Attribute>
        <Attribute name="Children:Task.@Count">6</Attribute>
    </Asset>
</Assets>

有人可以解释为什么返回的值总计为3,但。@ Sum显示97.2?

Can someone explain why the values returned total to 3, but the .@Sum shows 97.2?

推荐答案

最可能的原因是聚合函数,如 @Sum @Count 不要自动忽略已删除/已死的资产。

The most likely cause is that aggregate functions like @Sum and @Count don't automatically ignore deleted/dead assets.

您可能想要说:

rest-1.v1\Data\Story?
    sel=
        Children.ID,
        Children.Actuals.Value,
        Children:Task[AssetState!=Dead].@Count,
        Children[AssetState!=Dead].Actuals.Value.@Sum.Value
    &where=Number='B-02833'

这篇关于聚合似乎与VersionOne RESTful API中的数据不匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆