3 followers Follow

Calculate the total of each category instance in separate calculation fields.

I am trying to create a calculation field that simply counts the instances of a particular choice in another field within the same app. I will then use this number via a relationship in another app, but first things first. 

So:  The 'Software' category field has 'Software 1', 'Software 2', 'Software 3' options. 

In the 'Software 1 Use' field, I want a calculation that displays the number of items with 'Software 1' selected.

Seems like it should be so simple, but I've not been able to find any guidance. 


Andrew Francis

Please sign in to leave a comment.



Could you provide screenshot of your item?
I dont understand how many category fields you have

Andrew Pryhodchenko 0 votes
Comment actions Permalink

The example is hypothetical - one category field with five options - we'll call them Opt1, Opt2, Opt3, Opt4, Opt5

I want a single calculation field that can tell me how many items have Opt1 selected. 

I am designing this for software license tracking in a workstations inventory app. I have 50 licenses for W10 LTSC (Opt1) for example, and want to have a summary in my workstation inventory app to calculate: Total license (50) minus the number of workstations with the W10 LTSC category option selected. This would show on the dashboard so that I can see a snapshot of how many licenses are available, and of course, would transfer this knowledge to many other uses once I know how to do it. 

Hope that is clearer. Thanks! 

Andrew Francis 0 votes
Comment actions Permalink

If i understood your task correctly:

I created 3 categories with same options and selected different combinations.
In other field i wrote what i want to count, and counted it in calculation field;
3 sreenshots with different selections and count result attached,

My code not so pretty, but working) :

var c1=@Category 1.toString();
var c2=@Category 2.toString();
var c3=@Category 3.toString();
var f=@Want to find;
var c;
var t=0;


for (var i=0; i<c.length; i++)
if (c[i]==f){t++}



Andrew Pryhodchenko 0 votes
Comment actions Permalink

Thanks again Andrew - works as you created it inside each item, but does not count across all items in the app (like the data in the dashboard does) -

It DOES NOT work if I change the category options to text and include those options in the 'Want to count' field.

It DOES work if I include a number that is found in the field data - so, for example, 'W10 Enterprise LTSC' includes a 1 - if my 'Want to count' field has 1 in it, it will be counted, but if it has 'Enterprise' in it, the category will not be counted because, I assume, 'Enterprise' is text. 

Also, I only need one category field and have simplified my test app to have one field, but once I have it working, I may have several summary fields. These summary fields will then be used elsewhere by other apps. 

The example in the screenshot is local to my test app (no relationships) but I want to develop this to count the instances of each category option in other apps as well as this one. My understanding is that I need to create a relationship on all items to the other app, then change the @OS field to @all of OS? 

It's too bad the dashboard summaries can't be referenced...(or can they?) as they do exactly what I want to do. Summarize the number of category options in each item for the app. 


Many thanks! 


Andrew Francis 0 votes
Comment actions Permalink

Andrew Francis
Hi Andrew, 
you need another setup. You have 2 options:
Option 1:
Create an app OS with 4 items: W10 LTSC, W-Ten Pro, W 7 pro, Other. 
Instead of the category field OS add a relationship field OS which points to the app OS. 
In the app OS add a calculation field and enter: @All of OS.length
That counts the number of related Workstation items. In the app OS you have the overview for each OS. 

Option 2 (needs Globiflow): 
Create an app Reports with one item. In the Workstation app add a relationship field which points to the app Reports, name it "Report Relation". That field can be hidden cause it will be filled by Globiflow with the reference to the Report item. 
In the Report item you can have one field which creates a list with all 4 OS and their numbers. Or you have 4 fields, one for each OS where the number of licences is displayed. 
Cause all workstation items are related to the report item you can pull the used licenses numbers of all OS into the workstation items. 
A) You can use that report item for all other overviews/analysis you need from the workspace items.  
B)  You can use the calculated numbers to create widgets/tiles on the workspace home page (like the tiles created by Podio reports). 

I prefer option 2, have created such solutions for many Podio customers. You can add your custom filters or combine it with data from items in other apps etc. 


Rainer Grabowski 0 votes
Comment actions Permalink