Skip to main content
Participant
July 7, 2022
Question

Calculate how many items are there in each category

  • July 7, 2022
  • 1 reply
  • 200 views

I'm doing inventary of some items and I'm trying to count each Rented, Instock, Missing item and place it in their respective Total boxes. Each status box is a dropdown menu with the following options:
Rented

Instock

Missing 

Is there a way to use the Custom Calculation script feature to help me doing this.

 

Thank you in advance for reading and helping

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
July 7, 2022

For the Total Rented field you can use the following calculation script:

 

var count = 0;
for (var i=0; i<=32; i++) {
	if (this.getField("Status#."+i).valueAsString=="Rented") count++;
}
event.value = count;

 

Simply adjust the text in quotes and duplicate it for the other totals.