cancel
Showing results for 
Search instead for 
Did you mean: 

Create Lead report to calculate the duration between last changed on Date to current date.

former_member690694
Participant
0 Kudos

Dear Team,

Could you please provide the steps to create a lead report where we would like to calculate the duration between last changed on Date to current date. Please find attached design of report.

(Today date - Last change date of lead = How many leads having duration time between 5-10 days lead ) = 5 1st row 1st column value.

Thanks and Regards,

Madhu.

former_member690694
Participant

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member226
Employee
Employee
0 Kudos

Hello,

I see 2 issues here:

1. "Changed On" is not available as part of Key Figure unlike "Created On" date. Therefore it is difficult to create a new Key Figure which can calculate "Duration" based on Today-ChanegdOn date.

2. How many groups you want to create like 5-25 days, 25-50days etc? AFAIK, C4C doesn't support such dynamic column names based on their occurrence.

I doubt there is no standard solution to your issue.

From my experience I would ask you to use SAC or Excel or Any other Analytics tools to segregate the data for such a report.

former_member690694
Participant
0 Kudos

Hi Saurabh,

What I am planning to do please find below steps but I am still having doubt whether it will work out or not.

1) Add one KUT field called Duration days in lead information page then in SDK, we will pass the value in this fields like duration days = Current user date - Last change date of lead(Last change date of lead field is available).

2). Add KUT fields like 5-10 day, 11-15 days etc. in employee overview page then through SDK based on lead duration time field will pass the count in these field for each employee. employee is nothing but lead owner.

But for points 2, I want code like how can I get lead duration days KUT field in Employee.BO. script.

If it come there then we can use employee related data source to get all fields in report.

Please correct me if I am wrong.

Thanks and Regards,

Madhuri.

former_member226
Employee
Employee

Hello Madhuri,

This approach will work but not recommended. Reason: How many such custom fields (like 5-10 day, 11-15 days etc.) will you create? With each custom field your solution will become a bit tedious to maintain in the future. Therefore, it is always recommended by SAP to create as mimimal fields as possible to keep the core clean. If not handled properly it will create issues in the future. Further SAP also exposes a limit of 750+ field overall. So keeping that in mind creating such fields are not advisable for such a task.

However, if you just want to get the Leads based on Employee Data in SDK then you can still query the data using QueryByElements with PartyResponsibleEmployeePartyKey.PartyID.content as the respective employee's "Business Partner ID" .

import ABSL;
import AP.CRM.Global;
var query = LeanLead.QueryByElements;
var resultData = query.ExecuteDataOnly();
// 2. Selection
var selectionParams = query.CreateSelectionParams();
selectionParams.Add(query.PartyResponsibleEmployeePartyKey.PartyID.content, "I", "EQ", "8000000740");
// Result
 resultData = query.ExecuteDataOnly(selectionParams);
former_member690694
Participant
0 Kudos

Yes Saurabh you are right.. as this solution not accepted by my client as well with same. ..Now if we can make change on field as a key figure even custom field which is holding change on date then it will work out...2. to go column wise 10-15 days, 1620days we can keep aside right now..

Is there any way to add Key figure change on date custom field even..

Thanks and Regards,

Madhuri Dubey.

former_member690694
Participant
0 Kudos

Hi Saurabh,

What would be the code for Duedays = Today date - Last change date.

Regards,MD