Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Get Chart Row Count

I have a macro that I use to put a chart's row count in the caption of straight tables. But in the case below it's not correct due to repeated values of this particular chart. Does anyone know how I can get the DISTINCT count of the first dimension in order to display it in the caption?

error loading image

1 Solution

Accepted Solutions
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Brian,

you'd need to repeat the same Set Analysis expression in your count(distinct ...).

cheers,

View solution in original post

10 Replies
pover
Luminary Alumni
Luminary Alumni

Brian,

Is there anything wrong with using the following expression as a caption?

='Orders On Hold (' & count(distinct SO_NUM) & ')'

Regards.

Anonymous
Not applicable
Author

Unfortunately, that returns the number of distinct orders in the entire data set, not within just this chart (I have an expression with set analysis which limits which orders appear in this chart).

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Brian,

you'd need to repeat the same Set Analysis expression in your count(distinct ...).

cheers,

pover
Luminary Alumni
Luminary Alumni

Yeah, I had a feeling it wasn't that easy.

However, you could use the same set analysis in the count as in the expressions or something like the following.

='Orders On Hold (' & count({$<SO_NUM={"=expression1<>0 and expression2<>0"}>} distinct SO_NUM) & ')'

Regards.

Anonymous
Not applicable
Author

That did it, thanks.

Not applicable
Author

Hi can you please help me how to find the no of records displying in a table box object based on various filters.  I can able to see the no of records on a status bar, but i want to display that number value in a text object or in the header of the table box object.

Not applicable
Author

Hi can you please help me how to find the no of records displying in a table box object based on various filters.  I can able to see the no of records on a status bar, but i want to display that number value in a text object or in the header of the table box object.

i used below two expressions but not giving the right number.

='No of reccords in the table : ' & COUNT (DISTINCT [CustomerCode])

='No of reccords in the table : ' & COUNT (DISTINCT [CustomerCode]&[CustomerTitle]&[FirstName]&[LastName]&[Gender]&[Age]&[MarketingCampaignCode]&[MktgCampaignLongName]&[MarketingDate]&[ResponseCampaignCode]&[RespCampaignLongName]&[ResponseDate]&[CouponReceived]&[ResponseMethod]&[ContactDepartment]&[PA_FlatNumber]&[PA_HouseNumber]&[PA_HouseName]&[PA_StreetName]&[Locality]&[Town]&[PA_Country]&[PA_Zipcode]&[CustomerType]&[PreferredBranch_DaycentreCode]&[Dispenser]&[AppointmentDate]&[AppointmentType]&[TelephoneNo]&[MobilePhoneNo]&[PostcodeSector])

Its urgent for me....please help.

pover
Luminary Alumni
Luminary Alumni

What happens if you get rid of the distinct?

COUNT ([CustomerCode])

Karl

Not applicable
Author

Hi Karl

That's also not giving right number. I would like to know how many records are displayed in table object. It's result I can able to see on status bar when table object is selected.  So I want to display in a text box so that user can able to know the count always though table object is not selected.

I need some one help on this. Please reply if any one having the solution for it.

Thanks

PC Rao