Focal Point
[SOLVED] Compute Field -Sum value based on corresponding distinct value

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/1927024196

July 15, 2019, 12:34 PM
Delana Pellerin
[SOLVED] Compute Field -Sum value based on corresponding distinct value
How do I create a Compute Field with the Compute Calculator that Sums a measurement on all records that have the same distinct degenerate dimension value?

Scenario: A Claim File can have many Claim Sub Parts associated to it, but a Claim Sub Part is only associated to one File. I need the Sum of Total Loss Paid for each Sub Part associated to the same File.

An example end result would be if a File has 2 Sub Parts associated to it, and each Sub Part has $5,000 in Total loss Paid,then the File Total Loss Paid field for the Sub Part is $10,000.

This message has been edited. Last edited by: FP Mod Chuck,


Application Edition
SQL Server
July 15, 2019, 02:09 PM
BabakNYC
Is this what you're asking for?
 
TABLE FILE CAR
SUM RETAIL
COMPUTE SED_RETAIL/D12=IF TYPE EQ 'SEDAN' THEN RETAIL ELSE 0;
BY CAR 
END 



WebFOCUS 8206, Unix, Windows
July 15, 2019, 02:25 PM
Delana Pellerin
I am trying to create the Computed Field in App Studio Canvas. I do not want to add lines to the Text Editor. I want to be able to Insert a Compute Field and add the statement to the Compute Calculator within App Studio, and have the tool update the Master File Text on its own.

I also don't have an exact File Number to pass in the EQ statement. I just want the Sum of Total Paid Measurements for all of the records that have the same File Number


File ID Sub Part ID TTL Paid - SP TTL Paid - File
012345 012345010101 $5,000.00 $10,000.00
012345 012345020101 $5,000.00 $10,000.00


Application Edition
SQL Server
July 16, 2019, 08:39 AM
DWaybright
Delana,
When we need to do something similar in InfoAssist, we often use a HOLD file to hold the totals by the Claim File Number and then join it back to itself if we need to show details.
Hope that helps.


WebFOCUS 8.2.03 (production), 8.2.06 (testing)
AppStudio, InfoAssist
Windows, All Outputs
July 20, 2019, 02:31 PM
Delana Pellerin
The Hold File was exactly what I needed. Thank you.


Application Edition
SQL Server