大家好我需要你的幫助!我一直在研究一個代碼,它將獲得屬於第二級循環的每個唯一產品ID的總重量。這是我使用的代碼。但是我得到的輸出是110,應該只有60。先謝謝你!獲得獨特prodid的總重量
<xforms:bind calculate="sum(instance('Generated')/page1/table1/item[sublinesA[not(sublineA/prodid = preceding-sibling::sublinesA/sublineA/prodid)]]/sublinesA/sublineA[not(prodid = preceding-sibling::sublineA/prodid)]/weight)" nodeset"instance('Generated')/page1/table1/totalwgt"></xforms:bind>
<item>
<sublinesA>
<sublineA>
<prodid>AAA</prodid>
<weight>10</weight>
</sublineA>
<sublineA>
<prodid>AAA</prodid>
<weight>10</weight>
</sublineA>
<sublineA>
<prodid>BBB</prodid>
<weight>20</weight>
</sublineA>
</sublinesA>
</item>
<item>
<sublinesA>
<sublineA>
<prodid>BBB</prodid>
<weight>20</weight>
</sublineA>
<sublineA>
<prodid>BBB</prodid>
<weight>20</weight>
</sublineA>
<sublineA>
<prodid>CCC</prodid>
<weight>30</weight>
</sublineA>
</sublinesA>
</item>
<item>
<sublinesA>
<sublineA>
<prodid>CCC</prodid>
<weight>30</weight>
</sublineA>
</sublinesA>
</item>