Skip to main content

fieldvaluecount - script function

This script function returns the number of distinct values in a field. fieldname must be given as a string (for example a quoted literal).

Syntax:  

fieldvaluecount(fieldname)

Example:  

In this example the number of regions is counted and stored in the RegionCount variable. This value, 2 in this case, can then be used for further transformations where you need to know the number of existing regions.

LOAD * INLINE

[ Region, Year, Month, Sales

South, 2014, June, 645

North, 2014, May, 245

North, 2014, May, 347

North, 2014, June, 127

South, 2013, May, 367

South, 2013, July, 221 ];

 

Let RegionCount = FieldValueCount('Region');

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!

Join the Analytics Modernization Program

Remove banner from view

Modernize without compromising your valuable QlikView apps with the Analytics Modernization Program. Click here for more information or reach out: ampquestions@qlik.com