we have several True/False Booleans in AF (Fans on or off) and want to roll them up to count how many are on - but AF always give us the answer or zero no matter how many are on ???

we have several True/False Booleans in AF (Fans on or off) and want to roll them up to count how many are on - but AF always give us the answer or zero no matter how many are on ???

Thanks Karl - we suspected this might be the answer - just frustrating that the Boolean is probably stored as a 1 or 0 in the system so why can't it deal with this???

How it's stored is not that relevant. It's still a boolean, and two trues are not more true than one true. That's why it's a bool!. If you want to count occurrences, you need to do that, or convert a true into a '1' and a false into 0 and sum the values.

- 1 person found this helpful
Let's first clarify "RollUp". In one meaning it can be the combination of a number of other numbers, e.g. using the Formula Data Refernce, or an Expression analysis. A second meaning could be the use of the RollUp analysis, where attributes from child elements are aggregated to a higher level.

To answer for both cases (assuming all of these are values at a specific time, not doing any aggreations along the time axis):

- Counting how often a boolean is true can be done by converting the boolean to 0 or 1. Combining multiple attributes, cna be done by summing the individual values. This can be done easily using e.g. the formula data reference. Using e.g. the If-then-else construct to convert bool to integer (IF input THEN 1 ELSE 0), and summing the individual items. Conversion to string as mentioned in the original answer only works if the boolean is not a true bolean in AF, but a digital state set in PI using 0 for False and 1 for True.
- If you need to Rollup to a parent element, you can use analytics and the SUM aggregation, but you still need to do the conversion from boolean to integer as in the previous bullet item.

The count rollup counts events, so that won't work.

You need to convert that digital string to an integer.

See if this helps: Re: PI AF Formula Syntax

.