Skip to main content
Eric D
October 28, 2019
Solved

Count Objects in Org Chart using custom data field in Lucidchart

  • October 28, 2019
  • 15 replies
  • 1165 views

I have a custom field in a my Org Chart which I use to track whether a position is open or not (Open = Y). I'd like to add a field which looks at downstream objects and counts the occurrences of "Open = Y". This is similar to the built in "Head Count" field which is available on org charts out of the box but unfortunately I cannot see how that number is referenced in the chart please help.

Best answer by Keith R102

I answered my own question at least have something that is now working so wanted to share.  This formula works (and you can play w/ the downstream and downstreamdeep references)

 

=count(FILTER(downstreamdeep contains(@"Type" "Contractor")))

 

Certainly open to any other suggestions if there is a better/different/more efficient formula though!

Comments

Adam B102
June 5, 2023

John P the formulas support math operators. There may be a more elegant way to have the formula include the top level node but an easy workaround is to add a +1 to your formula. Here is an example where I am counting all people who have an office in the US and I wanted to include the person I connected to.

{{=count(Filter(downstreamdeep(graphnodes) contains(@"officename" "US")))+1}}

Adam B102
June 5, 2023

Also I wanted to post a solution to my previous question the support team here worked offline to help address my issue. In case you want to refer to the top node but do not want to have an arrow actually touching it in order for it to run these formulas....

  1. Create a custom field in which you will obtain the system id for the shape in your diagram. This is done by making a custom label field with a formula of "=LABEL(this)" without quotes. Once you add this field and then show it within your org shape in your diagram you will see its a very long cryptic name like "OSmebyP2zzj/ILNBzwWiitwggug="
  2. You can now use this label in the same way you did in the downstream nodes scenario.  Here is an example where I am using the label and then using another custom field to count the number of US employees. {{=#"OSmebyP2zzj/ILNBzwWiitwggug="."US"+1}}  You can see I am also using the +1 operator to get the similar result a previous poster was looking for where you want to include the top level connector.
John P104
June 5, 2023

Thanks Adam -- what if I need to count the current node only if it also matches the filter condition?

Richard Udell
Lucid support team
September 19, 2023

Hi @john p104

In order to count the current node only if it matches the filter condition consider the following example:

=IF(contains(@'Type' 'Contractor') 1 0) + count(Filter(downstreamdeep(graphnodes) contains(@'Type' 'Contractor')))

With this formula you can count the current node only if it meets the specified filter condition. You will likely need to customize it to your exact needs.

I also want to extend an invitation to any viewers of this thread to share any other tips tricks or formula innovations you come across. Your experiences and insights can greatly benefit the Lucid Community.

If you have more questions or need further assistance please don't hesitate to ask. Let's keep the collaboration going in this thread!

Micah
Lucid community team
May 6, 2024

Hi! I’m Micah from Lucid’s community team. 👋 I thought you, and any others who might come across this topic in the future, might be interested in Lucid’s Data Trusted User Group. This group is made up of knowledgeable users who regularly analyze and visualize data in their work. As part of this group, you’ll have the opportunity to connect directly with Lucid’s product team, gain early access to beta features, and share insights about your needs, shaping the future of Lucid’s data solutions 🎉 You can learn more and request to join here. Thanks!