Smartsite SXML CopyCode image Copy Code
<se:xmldatatable save="stock" resulttype="datatable">
    <se:row>
        <se:col name="product">Apples</se:col>
        <se:col name="productcategory">Fruit</se:col>
        <se:col name="instock" datatype="integer">14</se:col>
        <se:col name="price" datatype="float">1.23</se:col>
    </se:row>
    <se:row>
        <se:col>Peaches</se:col>
        <se:col>Fruit</se:col>
        <se:col>6</se:col>
        <se:col>1.66</se:col>
    </se:row>
    <se:row>
        <se:col>Carrots</se:col>
        <se:col>Vegetables</se:col>
        <se:col>36</se:col>
        <se:col>0.89</se:col>
    </se:row>
</se:xmldatatable>

Total in stock: {datatable.compute($stock, "sum(instock)")}
Total fruit in stock: {datatable.compute($stock,"sum(instock)", "productcategory='Fruit'")}
Example Result CopyCode image Copy Code
Total in stock: 56
Total fruit in stock: 20
SXML