| 1 | # CountIf |
| 2 | |
| 3 | > This query is available as `countif`. |
| 4 | |
| 5 | CountIf returns the percentage of points in the database that satisfy the condition supplied. |
| 6 | |
| 7 | The following conditions are available: |
| 8 | |
| 9 | - `!` or `!=` or `<>`, different than |
| 10 | - `=` or `==` or `:`, equal to |
| 11 | - `>`, greater than |
| 12 | - `<`, less than |
| 13 | - `>=`, greater or equal to |
| 14 | - `<=`, less or equal to |
| 15 | |
| 16 | The target number and the desired condition can be set using the `group_options` query parameter, as a string, like in these examples: |
| 17 | |
| 18 | - `!0`, to match any number except zero. |
| 19 | - `>=-3` to match any number bigger or equal to -3. |
| 20 | |
| 21 | . When an invalid condition is given, the web server can deliver a not accurate response. |
| 22 | |
| 23 | ## how to use |
| 24 | |
| 25 | This query cannot be used in alerts. |
| 26 | |
| 27 | `countif` changes the units of charts. The result of the calculation is always from zero to 1, expressing the percentage of database points that matched the condition. |
| 28 | |
| 29 | In APIs and badges can be used like this: `&group=countif&group_options=>10` in the URL. |
| 30 | |
| 31 |