a dataset with 2 columns activity 1 and activity 2 , only TRUE and FALSE is written in both these columns , this says whether the activity is done or not . so true is if its done and false is if its not done . want to know the out of all of much activity is done . the formula should be total no. of true/total no. of true + total no. of false.
1 Answers
If you want to know what percentage of records show Activity 1 as True (completed) and assuming Activity 1 is never null, then you could define a calculated field as:
SUM(INT([Activity 1])) / COUNT([Activity 1])
And then setting the number format for that calculated field to percentage
This takes advantage of two features:
- The function INT() converts boolean arguments to integers, but returning 1 for True and 0 for false. This is useful.
- The aggregate function COUNT([Some Field]) returns the number of records where [Some Field] has a value, any value - i.e. where the field is not null. So if [Some Field] always has a value, that is one way to count records
FWIW, a naming convention that I find convenient is to append a question mark to boolean field names so that they read like a question. If you can do that without the names getting too long, it helps make the charts and tables more clear. So if someone sees a column or legend with a title "Activity 1 Completed?", then the values True and False are self explanatory. Otherwise, it can be a bit ambiguous.
Another, tip is to use aliases, so True could be displayed as "Complete" and False could be displayed as "Incomplete" or such.
BTW, another approach is to first just display INT([Activity 1] - i.e. the ones and zeros. Then use quick table calcs to compute percentages.

- 11,301
- 2
- 26
- 49