Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Announcement: We have made updates to resolve a Page Not Found error. If you still get this error, please let us know in the Community Corner.
Highlighted
madeleine_josef
Contributor

KPI problems

Hi,

I have created a measure that tells me wether the assigment is insured or not with the following function: (StandardInsured = '1' or Household='1')

Now I would like to create a KPI using this measure, where the KPI tells me how many % of the chosen assignments that are insured. I tried with the following formunal for the KPI: count(StandardInsured = '1' or Household='1')/count(AssignmentNo)

But this does not give me a correct value.

Does anyone have any ideas on how to solve this?

Thanks!

Tags (1)
1 Solution

Accepted Solutions
MVP & Luminary
MVP & Luminary

Re: KPI problems

I think it should look more like:

count({< StandardInsured = {1}, Household = {1}>} AssignmentNo) / count(AssignmentNo)

with the assumption that your flags are numeric and not strings (which will be require the single-quotes like '1').

- Marcus

8 Replies
MVP & Luminary
MVP & Luminary

Re: KPI problems

I think it should look more like:

count({< StandardInsured = {1}, Household = {1}>} AssignmentNo) / count(AssignmentNo)

with the assumption that your flags are numeric and not strings (which will be require the single-quotes like '1').

- Marcus

madeleine_josef
Contributor

Re: KPI problems

Thank you, that looks right.

Now I get a count on the assignments that are both standard insured and household.

How would I write if I want to count the assignments that are either standard insured or household?

Thanks in advance

Re: KPI problems

Try this:

Count({<StandardInsured = {1}>+<Household = {1}>} AssignmentNo)/Count(AssignmentNo)

madeleine_josef
Contributor

Re: KPI problems

Hi,

I tried but I still get a very low % and I think it's because the expression is showing assignments that have both these conditions. I'm looking for assignments that have either or.

Do you have any suggestion on how to get this?

Re: KPI problems

You can always try this:

RangeSum(Count({<StandardInsured = {1}>} AssignmentNo), Count({<Household = {1}>} AssignmentNo))/Count(AssignmentNo)

madeleine_josef
Contributor

Re: KPI problems

Thank you, that looks better.

I have also created a dimension that I want to use in a table to show which assignments that are insured or not.

Currently I have the following expression: (StandardInsured = '1' or Household='1')

How can I change this to the better?

Also, right now this gives me a zero for when there's no insurance and -1 when there is insurance. Can I change this to true/false somehow?

Re: KPI problems

This dimension is created in the script or is this a calculated dimension? Can you elaborate a little.

Also, just as a suggestion for future request, I would suggest creating a new thread for new requirement. This way your question will get more exposure + it will be helpful for people using these in the future.

Best,

Sunny

madeleine_josef
Contributor

Re: KPI problems

I have written it in the script for creating a new dimension.

Here's the result: