Menu

Dashboard - group by, aggregation 'minimum' on AttributeDecimal - not considering decimals?

2021-03-27
2021-04-11
  • Jeffrey Bostoen

    Jeffrey Bostoen - 2021-03-27

    Does the output of an aggregate function (minimum) on an attribute of the AttributeDecimal type not consider decimals?

    I tried this on a custom class with an AttributeDecimal field; in the list I get, the decimals are missing?

     
  • Pierre Goiffon

    Pierre Goiffon - 2021-03-30

    Hello,

    I didn't find any documented limitation on this :/

    Can you provide an example so that we can reproduce on a fresh install ?

     
  • Jeffrey Bostoen

    Jeffrey Bostoen - 2021-04-11

    Hi Pierre. I just have a custom class with an AttributeDecimal

                    <field id="value" xsi:type="AttributeDecimal">
                        <sql>value</sql>
                        <is_null_allowed>false</is_null_allowed>
                        <default_value/>
                        <digits>10</digits>
                        <decimals>3</decimals>
                    </field>
    

    In the table when I do a group by and pick "minimum" (aggregate function), it only seems to group on the integer part. I haven't done further experimenting.

     
  • Jeffrey Bostoen

    Jeffrey Bostoen - 2021-04-11

    The bug seems to occur in the DisplayBlock::GetRenderContent() method

    More specifically this line:

    $aGroupBy[$iRow] = (int)$aRow[$sFctVar];
    

    If I change it to (Float), it works perfectly.
    Question is why it is an (int). Probably legacy from when the dashlet only supported Count() and not other aggregate functions?

    Update: I've made a ticket for this with my findings, possible solution and considerations.

     

    Last edit: Jeffrey Bostoen 2021-04-11

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.