Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Joseph_Kipling
New Contributor

Count measure is removing the records that don't match set analysis criteria

Hi all,

I have a few data sources joined together and I have produced a table with all the relevant dimensions I need. I have also added a calculated measure that only counts certain records based on the set analysis criteria but the calculation means the records that don't match the criteria have now been omitted from the table and the only records left show a value of '1' in the calculated field with the total at the top.

Is there anyway for the 'Count'({})' measure to still show the omitted records as a value of '0'? I have made work around by including another calculated field that counts all records... but this seem silly and counter intuitive to me?

Thanks, 

Joe

Labels (2)
11 Replies

Re: Count measure is removing the records that don't match set analysis criteria

Would you be able to share a sample where we can see what you have?

Joseph_Kipling
New Contributor

Re: Count measure is removing the records that don't match set analysis criteria

Yeah sure,

So without the added extra measure to include the other records I get this:

Screen Shot 2019-01-16 at 13.24.51.png

With the extra 'Fixed Counter' field I get this:

Screen Shot 2019-01-16 at 13.24.31.png

I would like the second table but only with one calculation...

The measures are:

Leads Count:

=count({<[Leads.Lead Number]={"=if(([Leads.LeadType]='Retail' and [Leads.LeadCode]=[Leaflet Design]) or ([Leads.LeadType]='Retail' and [Leads.IntervalWeek]<=4 and [Leads.ResponseChannel]='Web') or ([Leads.LeadType]='Retail' and [Leads.ResponseChannel]='Generic'),[Leads.Lead Number])"}>} distinct [Leads.LeadID]&[Leads.First]&[Leads.Last])

Fixed Count:

=count(distinct [Leads.LeadID]&[Leads.First]&[Leads.Last])

Thanks,

Joe

Re: Count measure is removing the records that don't match set analysis criteria


@Joseph_Kipling wrote:

 

I would like the second table but only with one calculation...


I still don't think I follow completely. You want both Leads Count and Fixed Counter, but you want to do this in a single expression? What would the output look like 0, 1 for the first row and 1, 1 for the second row? or just 01 and 11, respectively?

Joseph_Kipling
New Contributor

Re: Count measure is removing the records that don't match set analysis criteria

So the 'Fixed Counter' is only there for me to be able to see the records that where not counted by the 'Lead Count' measure.

My question is : Is there a way for me to see the records that where not counted by the 'Lead Count' but for this to be done with 1 measure? so 1 record might have a '1' when the criteria is met in the Lead Count measure and a '0' when it is not met..? At the moment it only shows all the '1' values for the Lead Count measure on it's own. 

 

Re: Count measure is removing the records that don't match set analysis criteria

Can you check if you have 'Include Zero Value' checked under Add-on -> Data Handling

Joseph_Kipling
New Contributor

Re: Count measure is removing the records that don't match set analysis criteria

Yes it is checked

Re: Count measure is removing the records that don't match set analysis criteria

Not sure, but if you are able to share your qvf file, I will be more than happy to take a look.

Highlighted
Joseph_Kipling
New Contributor

Re: Count measure is removing the records that don't match set analysis criteria

Do you need the qvf with the data?

Re: Count measure is removing the records that don't match set analysis criteria

Yes, but this doesn't have to be the original data... mocked up data where you can replicate the issue is good enough