QlikView Aggregate Functions

In QlikView, aggregate functions are used to perform calculations on data, such as summing, averaging, or counting data points. Aggregate functions are commonly used in QlikView to create measures, which are numerical values or metrics that can be used to analyze and visualize data.

Here are some examples of common aggregate functions in QlikView:

  1. SUM(): Calculates the sum of a set of values.
  2. AVG(): Calculates the average of a set of values.
  3. MIN(): Caluculate the minimum value in a set of values.
  4. MAX(): Finds the maximum value in a set of values.
  5. COUNT(): Counts the number of values in a set.

To use an aggregate function in QlikView, you can type it into the script editor or select it from the function library. You can then specify the data field or expression to be used in the calculation.

I hope this helps.

For example:

scssCopy code
=SUM(sales)

This will return the sum of all values in the ‘sales’ field.

scssCopy code
=COUNT(customer_id)

This will return the number of unique customer_id in the field.

scssCopy code
=AVG(sales)

This will return the average of all values in the ‘sales’ field.

scssCopy code
=MIN(sales)

This will return the minimum value in the ‘sales’ field.

scssCopy code
=MAX(sales)

This will return the maximum value in the ‘sales’ field.

In addition to these basic aggregate functions, QlikView also provides a number of advanced aggregate functions such as:

  • Aggr: This function is used to create aggregate calculations over a set of dimensions
  • Group By: This function is used to group a set of dimensions and perform aggregate calculations on each group
  • FirstSortedValue: This function returns the last value of a field sorted by another field

For example:

scssCopy code
=Aggr(SUM(sales), category, region)

This will return the sum of sales values grouped by category and region.

scssCopy code
=Group By(category, AVG(sales))

This will return the average of sales values grouped by category.

scssCopy code
=FirstSortedValue(sales, date)

This will return the first value of sales field sorted by date.

scssCopy code
=LastSortedValue(sales, date)

This will return the last value of sales field sorted by date.

These aggregate functions are very useful for performing calculations on large sets of data and for creating summary reports and visualizations such as bar charts, line charts, etc.

Leave a Reply

Your email address will not be published. Required fields are marked *