Skip to main content
Skip table of contents

What is the difference between the getRowCount method and the Approximate count distinct function?

getRowCount:

The getRowCount method retrieves the total number of rows returned by an API request (i.e., the number of lines matching the query).

You can use it in Data Query 3 by clicking Display number of rows in the bottom-right corner of the interface.

Use getRowCount when you need to know how many rows a query would return (for example, to estimate result size) rather than retrieving the full dataset.

mceclip0.png

You can also replace the getData function from your API call:

CODE
https://api.atinternet.io/v3/beta/data/getData?...

With the getRowCount function:

CODE
https://api.atinternet.io/v3/beta/data/getRowCount?...

Your call will then retrieve only one piece of information, indicating the number of lines in the request.

Approximate count distinct:

The Approximate count distinct function returns the approximate number of different non-null values for a property.

This function is based on an algorithm intended to make distinct counting feasible on large datasets, where exact distinct counts can be computationally expensive. The result has a typical 2% margin of error.

Applying Approximate count distinct produces a metric whose value is the result of the function (an estimated distinct count).

Use Approximate count distinct when you want to estimate how many unique values exist for a property (for example, unique users, unique IDs, unique page URLs) without computing an exact distinct count.

Animation.gif

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.