# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

New Contributor II

## KPI Calculating wrong value

Hi,

I am new to Qlik Sense.

When I am using below calculation in table to show data, its working fine.

if(status='Submitting' OR status= 'Composing' OR status= 'Submitted' , OrderNumer)

Above calculation gives me list of Order numbers.  The result is correct here. Number of records are 33.

But same calculation when I am using in KPI to show that count,  I am not getting expected result.

Below is calculation I am using for KPI.   (Even without DISTINCT)

COUNT( DISTINCT if(status='Submitting' OR status= 'Composing' OR status= 'Submitted' , OrderNumer))

This gives me more count in some cases. like 80 or 82 which is wrong (with or without DISTINCT).

Is it due to any null value or something.

1 Solution

Accepted Solutions
MVP

## Re: KPI Calculating wrong value

Maybe try Set Analysis.

Below typed freehand, so may have typo's :

Count (  { < [status] = { 'Submitting' , 'Composing' , 'Submitted' } > } distinct [OrderNumber] )

5 Replies
MVP

## Re: KPI Calculating wrong value

Maybe try Set Analysis.

Below typed freehand, so may have typo's :

Count (  { < [status] = { 'Submitting' , 'Composing' , 'Submitted' } > } distinct [OrderNumber] )

New Contributor II

## Re: KPI Calculating wrong value

Thanks a lot Bill..

working fine now with this set analysis.

but still thinking what is the difference,

In other KPI for same case, my previous calculation is giving exact result.

Anyways ... Thanks once again.

MVP

## Re: KPI Calculating wrong value

Hard to say without full visibility of your data and qvf.

But in general it is always better to use Set Analysis as it is a lot more efficient than If's, hence also best practice.