Jump to content
We've recently updated our Privacy Statement, available here ×

How to sum a row dynamically from different lists in json format


kliuvinis1

Recommended Posts

 

I have a report and i need to sum a row from different different product.

Example: 

[          {            "insuranceProductName": "Life",            "paymentGraph": [              {                "year": 1,                "premiumPerPeriod": 0.54              },              {                "year": 2,                "premiumPerPeriod": 9.03              },              {                "year": 3,                "premiumPerPeriod": 10              }            ]          },          {            "insuranceProductName": "Job",            "paymentGraph": [              {                "year": 1,                "premiumPerPeriod": 9.03              },              {                "year": 2,                "premiumPerPeriod": 9.03              },              {                "year": 3,                "premiumPerPeriod": 9.03              }            ]          }        ][/code]

So i need to sum insuranceProductName: Life first year premiumPerPeriod with insuranceProductName: Job first year premiumPerPeriod.

 insuranceProductName: Life second year premiumPerPeriod with insuranceProductName: Job second year premiumPerPeriod. and so on.

But it must be counted dynamically, because I don't know how may products or paymentGraphs gonna be there.

Example how it should look:

 

converted-file.png.f408c0f4b93b6bc629e91c01df70a7b0.png

So total for all is easy to count, but I'm struggling with counting separate totals, like for first year is 32,44, which I don't know how to count dynamically. 

 

converted-file.png.331c35d11194ba1e083b6a0704f9d9c3.png

This is how it looks now, i did all products with lists. The subreport hold names and a list with ????, is where I'm trying to do that sum. 

 

Thank you so much for your response.

 

 

 

Link to comment
Share on other sites

  • 2 weeks later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...