Skip to main content
Solved

Calculated Field

  • September 27, 2026
  • 4 replies
  • 53 views

In our LeanIX data model, each ISMS Initiative is linked to multiple ISMS Milestones. The milestone status can be Not Started, In Progress, or Completed. We would like to calculate the overall progress of the ISMS Initiative based on the statuses of its related milestones. Could you explain the best way to implement this calculation in LeanIX?

For ecample, an ISMS Initiative called "Implement Privileged Access Management" is linked to four ISMS Milestones. Each milestone has a status on the ISMS Milestone fact sheet:

MilestoneStatusScore

PAM Design Approved Completed 1
PAM Solution Procured Completed 1
PAM Deployment Started In Progress 0.5
PAM Production Rollout Not Started 0

If we assign the scores Completed = 1, In Progress = 0.5, and Not Started = 0, the overall progress of the initiative can be calculated as:

if we want to calculate the percentage of milestones that are fully completed only, the calculation would be
Completed Milestones / Total Milestones= 2 / 4= 50% 

Best answer by justinharclerode

Ksad, great question!

Here’s what I would do: 

 

1. Add a numeric custom field (e.g., overallProgress) to the ISMS Initiative fact sheet type via the Meta Model configuration.


2. Populate it via the LeanIX API using a script/webhook that:
   - Fetches each Initiative's linked ISMS Milestones
   - Reads the milestone status field
   - Calculates the score: sum(scores) / count(milestones)
   - Writes the result back to the Initiative's custom field

The scoring logic you described:

score = (completed × 1 + in_progress × 0.5 + not_started × 0) / total_milestones

For the PAM example: (1 + 1 + 0.5 + 0) / 4 = 62.5%

Or for "fully completed only": completed / total = 2 / 4 = 50%

 

Let me know if you need further help, happy to align with your CSM.

View original

4 replies

justinharclerode
Community Manager
Forum|alt.badge.img+1

Ksad, great question!

Here’s what I would do: 

 

1. Add a numeric custom field (e.g., overallProgress) to the ISMS Initiative fact sheet type via the Meta Model configuration.


2. Populate it via the LeanIX API using a script/webhook that:
   - Fetches each Initiative's linked ISMS Milestones
   - Reads the milestone status field
   - Calculates the score: sum(scores) / count(milestones)
   - Writes the result back to the Initiative's custom field

The scoring logic you described:

score = (completed × 1 + in_progress × 0.5 + not_started × 0) / total_milestones

For the PAM example: (1 + 1 + 0.5 + 0) / 4 = 62.5%

Or for "fully completed only": completed / total = 2 / 4 = 50%

 

Let me know if you need further help, happy to align with your CSM.


  • Author
  • Rookie
  • October 7, 2026

Thanks so much @justinharclerode . Can Calculation feature be used too under Administration>Advanced Setting?

I am trying to write the code but getting error : 
 

Multiple ISMSMilestone fact sheets are linked to a single ISMSInitiative fact sheet. Please create a calculation for the OverallProgress calculated field that evaluates the ISMSStatus field of all linked ISMSMilestone fact sheets.

The calculation should consider the following status values: Not Started, In Progress, and Completed. The OverallProgress should be calculated as the total number of Completed milestones divided by the total number of linked ISMSMilestone fact sheets, expressed as a percentage.

 


  • Author
  • Rookie
  • October 7, 2026

Hi ​@justinharclerode  I was able to configure the code , thanks much for your guidance. 

  1. Do I need to run the code manually every time the ISMS Milestone status is changed?

  2. How can I display the field value (e.g., 50% beside the factsheet header?)


justinharclerode
Community Manager
Forum|alt.badge.img+1

Hi ​@justinharclerode  I was able to configure the code , thanks much for your guidance. 

  1. Do I need to run the code manually every time the ISMS Milestone status is changed?

  2. How can I display the field value (e.g., 50% beside the factsheet header?)

1, If you’re running it locally or you need either a scheduler inside your script or one from your operating system.

2, you need to containerize the code in an azure function, lambda or something similar.