Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to show straight table count on header

sorry for posting a question which has been asked multiple times.. i have searched through all the posts but could not find a solution yet.. there is one thread where similar question was discussed -

http://community.qlik.com/thread/10054?start=0&tstart=0

problem -

i have a straight table type of chart... dimension is - Client

there are quite a few expressions like - ytd revenue, pytd revenue, ranks, etc

now the requirement is to show number of records on the table header.. it has to match exactly with # of rows displayed in the table.

first i tried - count(distinct client)

i have a common calendar which is linked to revenue data. App by default have 2011 year selected. so the count provides # of clients who made revenue in 2011.. although in the straight table has expressions like pytd built using set analysis so they ignore year selection... as such above above count may give 100 but the table could have 120 rows where those additional 20 clients made revenue only in last year.

is there any simple way to just show # of rows from the table as part of its header? i have about 20 complex expressions in the chart built using heavy set analysis applied... so considering all that logic just to get row count of the straight table chart may not be appropriate... my last option is to consider macors which i want to avoid since it has to be invoked on any change within the application...

thanks in advance!!

8 Replies
Not applicable
Author

bump!

Not applicable
Author

Go to Google and search on "QlikView Maven Count Rows in a Chart". That idea may work for you.

Not applicable
Author

thanks for the reply..

I am afraid that idea didnt work for me... am not sure if you have read my message. I want to avoid using the macro. And if I were to use macro, I'd something like below.. which to me seems much simpler than the macro found in the maven blog.

set chart =ActiveDocument.GetSheetObject("CH01")
ActiveDocument.Variables("ROWS_VAR").SetContent chart.GetNoOfRows, true
      

Not applicable
Author

That macro is certainly simpler! I had never used the GetNoOfRows object method. Without using a macro I think your best hope is to Count the result of an Aggr function that simulates your year & prior year logic. I hope someone can answer your question.

Not applicable
Author

Lately, I've been trying to solve the same problem in order to limit the number of rows in a straight table so that we can stay below a memory limit. I've got a straight table with three dimension columns - two of them have cycle groups and one of them is a date field named TDATE. I found I can predict the number of rows in the straight table with an expression like this:   sum(Aggr(1,$(=GetCurrentField(CYCLE_TABLE)),$(=GetCurrentField(Geographic_Hierarchy)),TDATE))             That gives you the exact row count except for rows where all of the columns except the dimension columns would be null - those rows are not displayed but they would be included in the expression.

jagan
Partner - Champion III
Partner - Champion III

Hi,

Try using the below expression

=Count({<Year={'>=$(=Max(Year)-1)<=$(=Max(Year))'}>} DISTINCT client)

Regards,

Jagan.

qliksus
Specialist II
Specialist II

Hi create a expression and Type 1  in the expression and name it as total rows

then in the Total mode of the expression tab select the Sum of rows this wil give you the

number of rows in the straight table

Not applicable
Author

Nilesh Bhattad

the macro works fine, but instead of "GetNoOfRows" it needs to be "GetRowCount"

so:

set chart = ActiveDocument.GetSheetObject("CH01")

ActiveDocument.Variables("ROWS_VAR").SetContent chart.GetRowCount, True

I know you don't want to use macro, but thought this might be useful for other viewers