Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Contributor III

Count Distinct for A Kpi

Hi Guys

Need your help if you can:

I am struggling with a measure I am trying to create.

In order to count the number of customers who are within their ordering frequency I have use the following:

if(Aggr(max([Last Order Date]),

[CustNo/CustName])+ sum(CustomerDays)/sum(OrderCounter)>today(),


“Aggr(max([Last Order Date]),[No/Name])+ sum(CustomerDays)/sum(OrderCounter)” uses the “Last Order Date” to establish when the customers are next due to order.

This works fine within a table visual however I would like to display the count as a KPI visual so the If statement does not work.

What is the best way for me to achieve this count?


2 Replies

Re: Count Distinct for A Kpi

it works in a table when there is a dimension:

so add this dimension in ur expression :


Re: Count Distinct for A Kpi

In your data model is CustNo a key field used to join 2 or more tables ?