Aggregate Top Hits source elements

I am getting units_agg = 0 . What am i doing wrong? I want to sum units in id_agg

'{
"size":1,

"aggs":
{
"article_agg":
{
"terms":
{
"field":"articleid"
},
"aggs":
{
"sku_agg":
{
"terms":
{
"field": "stockhistoryskuid"
},
"aggs":
{

                "id_agg":
                {
                    "top_hits": 
                    {
                        "sort": 
                        {
                            "id": 
                            {
                                "order": "asc"
                            }
                        },
                        "_source": 
                        {
                            "includes": [ "articleid", "units" ]
                        },
                        "size" : 1
                    }
                },
                "units_agg":
                {
                    "sum":
                    {
                        "field":"id_agg.units"
                    }
                }
               

               
                
                
            }
        }
            
   }

}
}}'

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.