# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

New Contributor II

## How to use filter in an expression and then use Count

Hi everybody.

I am a new to Qlik sense and I am hoping you can help with resolving issues I am having.

I need your help with this:

I have this table in Excel:

I need to create a KPI with this idea:

Total Status (Finish)/Total Accept (Ok) for each year and after create another KPI with the variation of 2016 vs 2017

My last idea was this:

If( Year('2017'),Count({<[Status]={'Finish'}>}[Status])/Count({<[Accept]={'Ok'}>}[Accept]),)

I try some diferents ways to do it but i can´t.

could your help me?!!

1 Solution

Accepted Solutions
MVP

## Re: How to use filter in an expression and then use Count

Try this instead

For 2017

Count({<[Status] = {'Finish'}, Year = {'2017'}>} [Status])/Count({<[Accept] = {'Ok'}, Year = {'2017'}>} [Accept])

For 2016

Count({<[Status] = {'Finish'}, Year = {'2016'}>} [Status])/Count({<[Accept] = {'Ok'}, Year = {'2016'}>} [Accept])

4 Replies
MVP

## Re: How to use filter in an expression and then use Count

Try this instead

For 2017

Count({<[Status] = {'Finish'}, Year = {'2017'}>} [Status])/Count({<[Accept] = {'Ok'}, Year = {'2017'}>} [Accept])

For 2016

Count({<[Status] = {'Finish'}, Year = {'2016'}>} [Status])/Count({<[Accept] = {'Ok'}, Year = {'2016'}>} [Accept])

New Contributor II

## Re: How to use filter in an expression and then use Count

Hi Sunny,

It's works perfectly.

Many thanks for your answer

Honored Contributor III

## Re: How to use filter in an expression and then use Count

If your question is now answered, please flag the Correct Answer (via the big "Correct Answer" button near every post; not visible in preview) and Helpful Answers (found under the Actions menu under every post).

If not, please make clear what part of this topic you still need help with .

May you live in interesting times!
New Contributor II

## Re: How to use filter in an expression and then use Count

Hi

I'm sorry, I didn't see the option.

My question was totally answered.

Thanks.