Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
kiranb13
Contributor III
Contributor III

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 (1)
  • SaaS

1 Reply
chrismarlow
Specialist II
Specialist II

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.