Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
danielnevitt
Creator
Creator

Distinct Expression Totals/Percentage

Hi,

When creating List Boxes with Sum Totals I use the following Expressions:

Sum(CONTRACT_QTY_MT)

Num((Sum(CONTRACT_QTY_MT)/Sum(total CONTRACT_QTY_MT)),'##0.0%)

However I would like to extend this to sum the CONTRACT_QTY_MT and also show as a % of the total CONTRACT_QTY_MT for distinct TRADE_NUM.  I created the below:

Sum(aggr(sum(Distinct CONTRACT_QTY_MT), TRADE_NUM)) - this works fine

Num((Sum(aggr(sum(Distinct CONTRACT_QTY_MT), TRADE_NUM))/Sum(total(aggr(sum(Distinct CONTRACT_QTY_MT), TRADE_NUM)),'##0.0%') - this however does not display any data

I believe my issue may be the number of brackets?

Any help with the above would be much appreciated.

Regards,

Daniel

6 Replies
narender123
Specialist
Specialist

Hi,

Yes you have missed the brackets.

Try this.

Num(Sum(aggr(sum(Distinct CONTRACT_QTY_MT), TRADE_NUM))/Sum(total(aggr(sum(Distinct CONTRACT_QTY_MT), TRADE_NUM)),'##0.0%'))

Thanks.

Narender

danielnevitt
Creator
Creator
Author

Hi Narender/er.mohit,

Thank you for your replies.

Unfortunately the % values still do not appear.

Am I doing something wrong?

Regards,

Daniel

narender123
Specialist
Specialist

You may try this ..

Num(Sum(aggr(sum(Distinct CONTRACT_QTY_MT), TRADE_NUM))/

Sum(total CONTRACT_QTY_MT),'##0.0%')

Thanks.

danielnevitt
Creator
Creator
Author

Hi Narender,

Thanks again for your reply.

Unfortunately it still doesn't work though.

The first bracket after Num is showing as red.  Not sure whether this is causing the problem?

Regards,

Daniel

narender123
Specialist
Specialist

Hi

Pls see the attachment file.

danielnevitt
Creator
Creator
Author

Thanks Narender.

I can see that the code works fine.  However when inputting against my data, it still shows as blank.

I am using source data from an XML file.  Do you think the XML file format might be causing the problem?

Regards,

Daniel