Total cost

Shpilmaa
Tera Contributor

Hi guys,

 

i have a table with cost and qty that changed every time, for example:

 

Shpilmaa_0-1703529094635.png

Cost 179 and qty 2 or 3 (it can be any number)

 

i want to make a report with bar chart for total cost, how can i make it?

 

thanks for advance!

 

1 ACCEPTED SOLUTION

You can create before (insert and update) business rule on your table.

Use script to calculate "Total Cost".

var totalCost = parseFloat(current.u_cost.getCurrencyValue()) *  parseFloat(current.u_quantity);
current.u_total_cost = current.u_cost.getCurrencyCode() + ';' + totalCost ; 

 

Note: replace your column names in above script.

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

View solution in original post

3 REPLIES 3

Anil Lande
Kilo Patron

Hi,

You can create a column name it as Total coset. you can save multiplication of Cost and Quantity in that field (using before BR) and it is easy to report on Total cost column.

 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

Hi, Thanks

 

It sounds right, but can you please expand? where do i have a multiple function (cost*qty) i cant find it 

You can create before (insert and update) business rule on your table.

Use script to calculate "Total Cost".

var totalCost = parseFloat(current.u_cost.getCurrencyValue()) *  parseFloat(current.u_quantity);
current.u_total_cost = current.u_cost.getCurrencyCode() + ';' + totalCost ; 

 

Note: replace your column names in above script.

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande