Marc
11/25/2024, 2:03 PMinternalid
. I use the following formula in a Formula (Numeric)
field to calculate a line-by-line value:
sql
{custrecordzab_c_subscription_item.custrecordzab_c_term_rate} * {custrecordzab_c_subscription_item.custrecordzab_c_quantity}
This works as expected to calculate the individual line values. However, I need another formula to calculate the total sum of this formula for all lines with the same internalid
and display this total sum on every line sharing the same internalid
(like in the Summary view).
For example, if the Summary view shows a grouped total for each internalid
, I want the same grouped total to appear on all lines for that internalid
in the Detailed view.
I tried using the formula:
sql
SUM({custrecordzab_c_subscription_item.custrecordzab_c_term_rate} * {custrecordzab_c_subscription_item.custrecordzab_c_quantity})
But this does not produce the correct result. I need a way to replicate the total from the Summary view on each line in the Detailed view.Celigo AI
11/25/2024, 2:03 PMAI generated answer (using internal Slack threads):Based on the conversations, it seems that the issue you're facing is related to the way you're trying to use the
SUM
function in your formula. In NetSuite Saved Searches, the SUM
function is used to add up all the values in a particular field. However, when you're trying to use it in a formula to calculate the total sum of a calculation for all lines with the same internalid
, it's not working as expected.
One of the common issues that people face when using SUM
in a formula is that they forget to put parentheses around the expression they're trying to sum. For example, in your case, the correct syntax would be:
sql
SUM({custrecordzab_c_subscription_item.custrecordzab_c_term_rate} * {custrecordzab_c_subscription_item.custrecordzab_c_quantity})
However, even with the correct syntax, you might still face issues if you're trying to use SUM
in a way that it's not intended to be used. For example, if you're trying to use SUM
to calculate the total sum of a calculation for all lines with the same internalid
, you might need to use a different approach.
One possible solution could be to use a subquery to calculate the total sum for each internalid
, and then join this subquery to your main query. However, please note that subqueries are not supported in NetSuite Saved Searches.
Another possible solution could be to use a scripting solution to calculate the total sum for each internalid
after the Saved Search has been executed. This would involve writing a SuiteScript that executes the Saved Search, loops through the results, and calculates the total sum for each internalid
.
Please note that these are just possible solutions and might not work in your specific case. You might need to experiment with different approaches to find a solution that works for you.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
11/25/2024, 2:03 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.846367598
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.84509331
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.844848394
Celigo AI
11/25/2024, 2:03 PM