Removing Duplicates and Sum Values in RG (Without DB)

Hi,

I have an api call which returns harvets time log data and I am not saving them in database.
Repeating Group is like this:

Ticket Name Hours
Ticket - 1 1.00
Ticket - 2 2.30
Ticket - 1 0.30

Instead, I’d like to show like this:

Ticket -1 1.30
Ticket -2 2.30

How can I remove duplicates and sum their hours without saving database ? Is it not possible without codding?

I really appreciated with the answers in advance.

Thanks

Hi serbestanil,

Definitely possible, you can use a grouping for that:

  1. Select ’ group by’ after selecting the API-response as a datasource for the RG:

  1. Select the field to group by, the type of aggregation ‘sum’ and the field the calculation should be performed on. In your case, field ‘Group by’ will be ‘Ticket name’, ‘Aggration 1’ is sum and ‘Field to calculate on’ is Hours.

Best,

Gerbert
MVP Design

Hi @gerbertdelangen,

I tried but it did not work. It is just grouping them together in the list. Am I doing something wrong here ? Data is not only about ticket name and hours, it has other values too by the way.

Here are the screen shots.

Repeating group:

Ticket Note:

Ticket hours:

Result:

As you see here, it has gold-48 and gold-56 multiple times.
The view would be like this:

GOLD-48 HP and PDP Modular Blocks 1.20
GOLD-56: Product recommendation 1.86
GOLD-79: Coupon code re calculation 0.88

Any idea?
Thanks

Strange, for me it works. Yeah, I’m using it with an API that has other fields too, because of the group by this works. As you can see, the type and data source are no longer the API response, but the grouping of the API response.

Do you mind to post the raw JSON?

Hey Gerbert,

You navigated me to find out the problem mate, thanks! Your solution is working and it is grouping by notes. The issue here is that other ones have different titles. (Search GOLD-56: Product recommendation on json)

So, I need to find a way that is grouping by starting with G and ending with “:”. Therefore, it will group same tickets at end. I could not find a way to do this. (I was thinking using Regex but it does not appear)

Do you have any idea?

Thanks

I am not able to attach json here.

[
  {
    "hours": "0.24",
    "is_locked": "no",
    "is_running": "no",
    "locked_reason": "",
    "notes": "GOLD-56: Product recommendation",
    "spent_date": "2023-03-02"
  },
  {
    "hours": "0.25",
    "is_locked": "no",
    "is_running": "no",
    "locked_reason": "",
    "notes": "GOLD-48: HP and PDP Modular Blocks\n\ncreated detailed comment",
    "spent_date": "2023-02-28"
  },
  {
    "hours": "0.18",
    "is_locked": "no",
    "is_running": "no",
    "locked_reason": "",
    "notes": "- PR deployment stage GOLD-96\n\n",
    "spent_date": "2023-02-28"
  },
  {
    "hours": "0.23",
    "is_locked": "no",
    "is_running": "no",
    "locked_reason": "",
    "notes": "- update project locally \n- view/update ticket GOLD-96\n- PR deployment stage GOLD-96",
    "spent_date": "2023-02-28"
  },
  {
    "hours": "0.42",
    "is_locked": "no",
    "is_running": "no",
    "locked_reason": "",
    "notes": "GOLD-48: HP and PDP Modular Blocks\n\nreviewed how widget and page builder can be used and planned few bits with Tanil",
    "spent_date": "2023-02-27"
  },
  {
    "hours": "0.53",
    "is_locked": "no",
    "is_running": "no",
    "locked_reason": "",
    "notes": "GOLD-48: HP and PDP Modular Blocks\n\nHad meeting about this task and went through the requirement and also mentioned few ways we can complete this task",
    "spent_date": "2023-02-27"
  },
  {
    "hours": "0.35",
    "is_locked": "no",
    "is_running": "no",
    "locked_reason": "",
    "notes": "call with Tanil about pagebuilder on PDP",
    "spent_date": "2023-02-27"
  },
  {
    "hours": "1.4",
    "is_locked": "yes",
    "is_running": "no",
    "locked_reason": "Item Approved and Locked for this Time Period",
    "notes": "GOLD-56: Product recommendation\n\ninstalled module but it had conflict on staging, so had to solve that and reinstall.\n\nhad to comment detailed comment for live deployment.\nchecked settings are on staging, so reported that this can be tested",
    "spent_date": "2023-02-24"
  },
  {
    "hours": "0.12",
    "is_locked": "yes",
    "is_running": "no",
    "locked_reason": "Item Approved and Locked for this Time Period",
    "notes": "GOLD-56: Product recommendation",
    "spent_date": "2023-02-24"
  },
  {
    "hours": "1.78",
    "is_locked": "yes",
    "is_running": "no",
    "locked_reason": "Item Approved and Locked for this Time Period",
    "notes": "GOLD-87: Amend \"Homepage Hero Banner\" options for text position\n\ncompleted the task, deployed to staging, tested and reported.\n",
    "spent_date": "2023-02-24"
  },
  {
    "hours": "0.17",
    "is_locked": "yes",
    "is_running": "no",
    "locked_reason": "Item Approved and Locked for this Time Period",
    "notes": "GOLD-87: Amend \"Homepage Hero Banner\" options for text position",
    "spent_date": "2023-02-24"
  },
  {
    "hours": "0.14",
    "is_locked": "yes",
    "is_running": "no",
    "locked_reason": "Item Approved and Locked for this Time Period",
    "notes": "GOLD-48: HP and PDP Modular Blocks",
    "spent_date": "2023-02-24"
  },
  {
    "hours": "1.23",
    "is_locked": "yes",
    "is_running": "no",
    "locked_reason": "Item Approved and Locked for this Time Period",
    "notes": "GOLD-87: Amend \"Homepage Hero Banner\" options for text position\n\nadded mobile postions and did the styling (in progress)",
    "spent_date": "2023-02-24"
  },
  {
    "hours": "1.33",
    "is_locked": "yes",
    "is_running": "no",
    "locked_reason": "Item Approved and Locked for this Time Period",
    "notes": "GOLD-99: HP Block 5-2 settings is not working correctly\n\nreviewed, found the issue, fixed.\n\ntested by disabling block 4 and 5_2 to be sure.\n\ndeployed on staging and retested and commented.",
    "spent_date": "2023-02-24"
  },
  {
    "hours": "0.52",
    "is_locked": "yes",
    "is_running": "no",
    "locked_reason": "Item Approved and Locked for this Time Period",
    "notes": "GOLD-87: Amend \"Homepage Hero Banner\" options for text position\n\nreviewed the task and estimated (checked code to be sure) \n",
    "spent_date": "2023-02-24"
  },
  {
    "hours": "0.42",
    "is_locked": "no",
    "is_running": "no",
    "locked_reason": "",
    "notes": "Deployment",
    "spent_date": "2023-02-22"
  },
  {
    "hours": "0.28",
    "is_locked": "yes",
    "is_running": "no",
    "locked_reason": "Item Approved and Locked for this Time Period",
    "notes": "RE: gtm tag add to cart",
    "spent_date": "2023-02-22"
  },
  {
    "hours": "1.87",
    "is_locked": "yes",
    "is_running": "no",
    "locked_reason": "Item Approved and Locked for this Time Period",
    "notes": "GOLD-94: Replace Fonts for Collagen Superdose",
    "spent_date": "2023-02-21"
  },
  {
    "hours": "0.25",
    "is_locked": "yes",
    "is_running": "no",
    "locked_reason": "Item Approved and Locked for this Time Period",
    "notes": "- project management \n- view/update ticket\n- update local - reinstall live search locally  GOLD-55",
    "spent_date": "2023-02-21"
  },
  {
    "hours": "0.26",
    "is_locked": "yes",
    "is_running": "no",
    "locked_reason": "Item Approved and Locked for this Time Period",
    "notes": "speaking to tanil about GOLD-55",
    "spent_date": "2023-02-21"
  },
  {
    "hours": "0.02",
    "is_locked": "yes",
    "is_running": "no",
    "locked_reason": "Item Approved and Locked for this Time Period",
    "notes": "GOLD-96: Hide \"One Time Purchase\" in PDP",
    "spent_date": "2023-02-21"
  },
  {
    "hours": "0.33",
    "is_locked": "yes",
    "is_running": "no",
    "locked_reason": "Item Approved and Locked for this Time Period",
    "notes": "GOLD-34: Fastly GEO Redirect",
    "spent_date": "2023-02-21"
  },
  {
    "hours": "0.03",
    "is_locked": "yes",
    "is_running": "no",
    "locked_reason": "Item Approved and Locked for this Time Period",
    "notes": "GOLD-34: Fastly GEO Redirect",
    "spent_date": "2023-02-20"
  },
  {
    "hours": "0.02",
    "is_locked": "yes",
    "is_running": "no",
    "locked_reason": "Item Approved and Locked for this Time Period",
    "notes": "GOLD-56: Product recommendation",
    "spent_date": "2023-02-20"
  },
  {
    "hours": "0.13",
    "is_locked": "yes",
    "is_running": "no",
    "locked_reason": "Item Approved and Locked for this Time Period",
    "notes": "GOLD-82: Install ReferralCandy Magento 2 Module",
    "spent_date": "2023-02-20"
  },
  {
    "hours": "0.11",
    "is_locked": "yes",
    "is_running": "no",
    "locked_reason": "Item Approved and Locked for this Time Period",
    "notes": "GOLD-83: Video in HP Banner doesn't work",
    "spent_date": "2023-02-20"
  },
  {
    "hours": "0.34",
    "is_locked": "yes",
    "is_running": "no",
    "locked_reason": "Item Approved and Locked for this Time Period",
    "notes": "GOLD-86: Edit Dispatch Email Template - Not showing correct price for Subscription multiples",
    "spent_date": "2023-02-20"
  },
  {
    "hours": "0.1",
    "is_locked": "yes",
    "is_running": "no",
    "locked_reason": "Item Approved and Locked for this Time Period",
    "notes": "GOLD-83: Video in HP Banner doesn't work",
    "spent_date": "2023-02-20"
  },
  {
    "hours": "0.26",
    "is_locked": "yes",
    "is_running": "no",
    "locked_reason": "Item Approved and Locked for this Time Period",
    "notes": "PR -deployment staging  GOLD-83",
    "spent_date": "2023-02-20"
  },
  {
    "hours": "1.8",
    "is_locked": "no",
    "is_running": "no",
    "locked_reason": "",
    "notes": "GOLD-86: Edit Dispatch Email Template - Not showing correct price for Subscription multiples",
    "spent_date": "2023-02-20"
  },
  {
    "hours": "2.34",
    "is_locked": "yes",
    "is_running": "no",
    "locked_reason": "Item Approved and Locked for this Time Period",
    "notes": "GOLD-83: Video in HP Banner doesn't work",
    "spent_date": "2023-02-20"
  },
  {
    "hours": "0.13",
    "is_locked": "yes",
    "is_running": "no",
    "locked_reason": "Item Approved and Locked for this Time Period",
    "notes": "- project management \n- view/update tickets GOLD-83\n- update local env",
    "spent_date": "2023-02-20"
  },
  {
    "hours": "0.89",
    "is_locked": "no",
    "is_running": "no",
    "locked_reason": "",
    "notes": "GOLD-87: Amend \"Homepage Hero Banner\" options for text position",
    "spent_date": "2023-02-20"
  },
  {
    "hours": "0.02",
    "is_locked": "no",
    "is_running": "no",
    "locked_reason": "",
    "notes": "GOLD-83: Video in HP Banner doesn't work",
    "spent_date": "2023-02-20"
  },
  {
    "hours": "0.4",
    "is_locked": "no",
    "is_running": "no",
    "locked_reason": "",
    "notes": "GOLD-91: EMAIL FOOTER in TEMPLATE",
    "spent_date": "2023-02-20"
  },
  {
    "hours": "3.21",
    "is_locked": "yes",
    "is_running": "no",
    "locked_reason": "Item Approved and Locked for this Time Period",
    "notes": "GOLD-94: Replace Fonts for Collagen Superdose",
    "spent_date": "2023-02-20"
  },
  {
    "hours": "0.38",
    "is_locked": "yes",
    "is_running": "no",
    "locked_reason": "Item Approved and Locked for this Time Period",
    "notes": "",
    "spent_date": "2023-02-17"
  },
  {
    "hours": "1.42",
    "is_locked": "no",
    "is_running": "no",
    "locked_reason": "",
    "notes": "GOLD-82: Install ReferralCandy Magento 2 Module",
    "spent_date": "2023-02-17"
  },
  {
    "hours": "0.29",
    "is_locked": "yes",
    "is_running": "no",
    "locked_reason": "Item Approved and Locked for this Time Period",
    "notes": "GOLD-94: Replace Fonts for Collagen Superdose",
    "spent_date": "2023-02-17"
  },
  {
    "hours": "0.1",
    "is_locked": "no",
    "is_running": "no",
    "locked_reason": "",
    "notes": "GOLD-82: Install ReferralCandy Magento 2 Module",
    "spent_date": "2023-02-17"
  },
  {
    "hours": "0.14",
    "is_locked": "no",
    "is_running": "no",
    "locked_reason": "",
    "notes": "GOLD-84: Link GUEST subscription to real customer",
    "spent_date": "2023-02-17"
  },
  {
    "hours": "0",
    "is_locked": "yes",
    "is_running": "no",
    "locked_reason": "Item Approved and Locked for this Time Period",
    "notes": "GOLD-82: Install ReferralCandy Magento 2 Module",
    "spent_date": "2023-02-17"
  },
  {
    "hours": "2.7",
    "is_locked": "yes",
    "is_running": "no",
    "locked_reason": "Item Approved and Locked for this Time Period",
    "notes": "GOLD-28: Replace \"ABBONATI\" with \"ISCRIVITI\"",
    "spent_date": "2023-02-17"
  },
  {
    "hours": "0.27",
    "is_locked": "no",
    "is_running": "no",
    "locked_reason": "",
    "notes": "GOLD-83: Video in HP Banner doesn't work",
    "spent_date": "2023-02-16"
  },
  {
    "hours": "1.29",
    "is_locked": "no",
    "is_running": "no",
    "locked_reason": "",
    "notes": "GOLD-88: Subsequent orders errors",
    "spent_date": "2023-02-16"
  },
  {
    "hours": "1.23",
    "is_locked": "no",
    "is_running": "no",
    "locked_reason": "",
    "notes": "GOLD-95: Webhook responses delay and Pending orders issue",
    "spent_date": "2023-02-16"
  },
  {
    "hours": "2.42",
    "is_locked": "yes",
    "is_running": "no",
    "locked_reason": "Item Approved and Locked for this Time Period",
    "notes": "GOLD-28: Replace \"ABBONATI\" with \"ISCRIVITI\"",
    "spent_date": "2023-02-16"
  },
  {
    "hours": "0.08",
    "is_locked": "yes",
    "is_running": "no",
    "locked_reason": "Item Approved and Locked for this Time Period",
    "notes": "GOLD-28: Replace \"ABBONATI\" with \"ISCRIVITI\"",
    "spent_date": "2023-02-16"
  },
  {
    "hours": "1.63",
    "is_locked": "no",
    "is_running": "no",
    "locked_reason": "",
    "notes": "GOLD-82: Install ReferralCandy Magento 2 Module",
    "spent_date": "2023-02-16"
  },
  {
    "hours": "0.23",
    "is_locked": "no",
    "is_running": "no",
    "locked_reason": "",
    "notes": "GOLD-91: EMAIL FOOTER in TEMPLATE",
    "spent_date": "2023-02-12"
  },
  {
    "hours": "0.73",
    "is_locked": "no",
    "is_running": "no",
    "locked_reason": "",
    "notes": "GOLD-90: Unhide \"STORE CREDIT\" payment method from Checkout",
    "spent_date": "2023-02-12"
  },
  {
    "hours": "0.21",
    "is_locked": "no",
    "is_running": "no",
    "locked_reason": "",
    "notes": "GOLD-84: Link GUEST subscription to real customer",
    "spent_date": "2023-02-12"
  },
  {
    "hours": "1.21",
    "is_locked": "no",
    "is_running": "no",
    "locked_reason": "",
    "notes": "GOLD-90: Unhide \"STORE CREDIT\" payment method from Checkout",
    "spent_date": "2023-02-12"
  },
  {
    "hours": "1.2",
    "is_locked": "no",
    "is_running": "no",
    "locked_reason": "",
    "notes": "GOLD-82: Install ReferralCandy Magento 2 Module",
    "spent_date": "2023-02-10"
  },
  {
    "hours": "0.44",
    "is_locked": "no",
    "is_running": "no",
    "locked_reason": "",
    "notes": "GOLD-85: Changing title on account menu",
    "spent_date": "2023-02-10"
  },
  {
    "hours": "0.18",
    "is_locked": "no",
    "is_running": "no",
    "locked_reason": "",
    "notes": "GOLD-89: Staging site is down",
    "spent_date": "2023-02-09"
  },
  {
    "hours": "0.42",
    "is_locked": "yes",
    "is_running": "no",
    "locked_reason": "Item Approved and Locked for this Time Period",
    "notes": "GOLD-89: Staging site is down",
    "spent_date": "2023-02-09"
  },
  {
    "hours": "0.5",
    "is_locked": "yes",
    "is_running": "no",
    "locked_reason": "Item Approved and Locked for this Time Period",
    "notes": "Weekly Account Call",
    "spent_date": "2023-02-08"
  },
  {
    "hours": "0.47",
    "is_locked": "no",
    "is_running": "no",
    "locked_reason": "",
    "notes": "GOLD-89: Staging site is down",
    "spent_date": "2023-02-08"
  },
  {
    "hours": "0.28",
    "is_locked": "no",
    "is_running": "no",
    "locked_reason": "",
    "notes": "GOLD-82: Install ReferralCandy Magento 2 Module",
    "spent_date": "2023-02-08"
  },
  {
    "hours": "1.62",
    "is_locked": "no",
    "is_running": "no",
    "locked_reason": "",
    "notes": "GOLD-82: Install ReferralCandy Magento 2 Module",
    "spent_date": "2023-02-07"
  },
  {
    "hours": "0.08",
    "is_locked": "yes",
    "is_running": "no",
    "locked_reason": "Item Approved and Locked for this Time Period",
    "notes": "GOLD-56: Product recommendation",
    "spent_date": "2023-02-07"
  },
  {
    "hours": "0.08",
    "is_locked": "yes",
    "is_running": "no",
    "locked_reason": "Item Approved and Locked for this Time Period",
    "notes": "GOLD-85: Changing title on account menu",
    "spent_date": "2023-02-07"
  },
  {
    "hours": "0.17",
    "is_locked": "yes",
    "is_running": "no",
    "locked_reason": "Item Approved and Locked for this Time Period",
    "notes": "GOLD-28: Replace \"ABBONATI\" with \"ISCRIVITI\"",
    "spent_date": "2023-02-07"
  },
  {
    "hours": "0.28",
    "is_locked": "no",
    "is_running": "no",
    "locked_reason": "",
    "notes": "GOLD-85: Changing title on account menu",
    "spent_date": "2023-02-07"
  },
  {
    "hours": "0.37",
    "is_locked": "no",
    "is_running": "no",
    "locked_reason": "",
    "notes": "GOLD-85: Changing title on account menu",
    "spent_date": "2023-02-07"
  },
  {
    "hours": "0.67",
    "is_locked": "yes",
    "is_running": "no",
    "locked_reason": "Item Approved and Locked for this Time Period",
    "notes": "GOLD-28: Replace \"ABBONATI\" with \"ISCRIVITI\"",
    "spent_date": "2023-02-07"
  },
  {
    "hours": "0.25",
    "is_locked": "yes",
    "is_running": "no",
    "locked_reason": "Item Approved and Locked for this Time Period",
    "notes": "GOLD-79: Coupon code re calculation",
    "spent_date": "2023-02-06"
  },
  {
    "hours": "0.43",
    "is_locked": "no",
    "is_running": "no",
    "locked_reason": "",
    "notes": "GOLD-79: Coupon code re calculation",
    "spent_date": "2023-02-03"
  },
  {
    "hours": "0.2",
    "is_locked": "no",
    "is_running": "no",
    "locked_reason": "",
    "notes": "GOLD-79: Coupon code re calculation",
    "spent_date": "2023-02-01"
  }
]`

I created separate question for that in case you want to answer.

Thanks for the solution in this ticket.

1 Like