Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Count on value list

Hi Qlik

Thank you for helping.

I have column called 'P' in one table.

In another table i have column called 'reason'. I joined 2 tables by 2 keys: seriesID and StudyID (not in Load Editor).

Now i want to count how many seriesID is in 'P' column and has 'FP' values in 'reason' column.

My example is just on one coumn called 'P'. The data includes more colums that i need to count in (So my value list would be with more values).

This is my expression:

DIM:

ValueList('P')

MEASURE:

IF(ValueList('P')

= 'P',

count({$<result={"FP"}>}result))

However, the result i got is total count of 'FP' values in 'reason' column (Not just the count of 'P' matching the seriesID).

Thank you for helping.

4 Replies
sunny_talwar

Why don't you try this without using valuelist() function....

Dimension

P

Expression

Count({$<result = {'FP'}>} result)

sunny_talwar

or this

Count(TOTAL {$<result = {'FP'}>} result)

Not applicable
Author

Because i want to use more 3 columns to count in one chart.

I tried without valuelist and the result is the same as with value list. Its count the total of FP in table 2. What i need is to count the FP values in table 2 that match the P column in table 1.

sunny_talwar

May be create Flags in your tables like this:

Table1:

LOAD P,

          'Table1' as Flag1

....

and similarly for your second table and then may be this:

DIM:

ValueList('P')

MEASURE:

IF(ValueList('P')

= 'P',

count({$<result={"FP"}, Flag = {'Table1'}>}result))