Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Customers, Partners & Luminaries only: You're invited to a Data Analytics Roadmap session. Read More
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor II
Contributor II

KPI showing wrong count

 Hi Team,

Below is the scenario.

kiranb13_0-1596646202988.png

kiranb13_1-1596646283823.png

 

Expression in table : 

=If(Date([Consumption Date])=Date([Scheduled Date]),Date([Scheduled Date]))

Expression in KPI:

=sum(If(Date([Consumption Date])=Date([Scheduled Date]),1))

There are 12 records in table. But in KPI i am getting the value as 36. I tried with count expression as well.

=count(If(Date([Consumption Date])=Date([Scheduled Date]),Date([Scheduled Date]))

Can anyone help me out here with the correct expression to get value as 12 ?

Labels (2)
1 Reply
Highlighted
Specialist
Specialist

Hi,

I think you must have multiple records with same combination of the 3 fields (which may or may not be right) for your KPI to stop counting the duplicates try;

=count(distinct If(Date([Consumption Date])=Date([Scheduled Date]),[Scheduled Date]))

Cheers,

Chris.