# Qlik Sense App Development

New Contributor

## Combination Count+Distinct+Modifier

Hi,

I wan to extract unique values out of the label "ID-LeadID". In the data base I loaded the actual status of all existing Leads (whatever the actual status is) and the changes. I only want the data defined selections:

For this selection there are 126 unique Leads with 317 changes.

As I want to know the unique number of Leads, I tried this Formula:

The result is 317, as expected (changes). I tried several combinations of formula with distinct (many different positions in the formula), but I did not get once the result of 126 unique values.

The Result was either 0 or 317 :-(

BR from Germany

Benjamin

6 Replies
MVP

Did you try this

MVP

## Re: Combination Count+Distinct+Modifier

Also, Distinct count of Id-LeadId is 127 or is a portion of Id-LeadId's distinct count is 127? Little confused

New Contributor

## Re: Combination Count+Distinct+Modifier

‌i did the formula, but the result was still 317 :-(

this was also my first guess, but it wasn‘t the right solution.

Is may another position possible for the distinct value weithin the formula the Key?

The data are loaded in two tables:

Table A (table for actual status):

Table B (table for changes)

## Re: Combination Count+Distinct+Modifier

Is the lead-id the key between the tables A and B or is there a different key and the lead-id fields in both tables are different? Are further tables connected to these tables? I think a screenshot from the tableviewer would be helpful.

- Marcus

New Contributor

## Re: Combination Count+Distinct+Modifier

Hi,

the lead id key is between table A (lead) and table B (Lead history) and the keys are not different.

There are other tables connected, but the formula contains no request to other tables.

The Key link between the tables is strong as you can see in the screenshot:

Hopefully this will help.

Thanks

Benjamin

## Re: Combination Count+Distinct+Modifier

I believe the general qlik recommendation is not to use key-fields within calculations else to use duplicated fields for it, for example:

...