Can I combine multiple tables, but how do I multiply two column values ?

Unal UN asked on January 19, 2018 08:01

    CustomTableItemProvider.GetItems<MyJoinUserItem>().Source(s => s.LeftJoin<MyJoinOrderItem>("ItemID", "UserID").LeftJoin<MyJoinProductItem>("ProductID", "ItemID")).Columns("Name", "ProductName", "ProductPrice","Count").Result;

Can I combine multiple tables, but how do I multiply two column values ? Examples

TotalPrice = ProductPrice * Count

Correct Answer

Brenden Kehren answered on January 19, 2018 08:24

Are you able to add this to your ObjectQuery?

.AddColumn(new AggregatedColumn(AggregationType.Sum, " ProductPrice * Count").As("TotalPrice"))

You'll need to also add this using statement to include this:

using CMS.DataEngine;

The other option if this doesn't give you the results you're expecting is to do the math on output in the transformation.

1 votesVote for this answer Unmark Correct answer

Recent Answers


Unal UN answered on January 19, 2018 11:43

Thank you Brenden

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.