Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey there!
i have a chart table "A" and i want to show the number of rows in table A in a separate text object.
Can I do that?
Thanks!
Mor
=count(some_table_field)
or
=count({1} some_table_field)
(disregarding selections)
add one more line in script while loading table
RowNO() as NO
Now use
COUNT(NO)
or
Max(NO)
in text box
H,
it is possible and refer the screen shot.Here I have selected a Dim and a expression. Also do note the Total mode that I have showed.You can also hide Dim column if you do not want to show alist under presentation.
thanx
Hi,
You can use count function.
Like count(Field), Here Field -> you have to use any dimensional field in that chart.
or u can use macro also
SUB ReadRowsCount
set v = ActiveDocument.GetVariable("Variable")
v.SetContent ActiveDocument.GetSheetObject( "ChartId" ).GetRowCount-1, true
end SUB
-Sathish
Hey!
Thanks for your advices, but i don't want to count the rows in a table that i load into Qlikview, i want to count the rows in a table chart i have in my dashboard.
Sathish - i don't understand what i need to do with your macro, what should i write in the text object what will show there the table row count?
Hi you can even use this macro
Sub CountRow
set chart = ActiveDocument.GetSheetObject("CH01")
'msgbox("number of class members = "&chart.GetNoOfRows)
set v = ActiveDocument.Variables("RowsNum")
v.SetContent chart.GetNoOfRows,true
End Sub
Hi Mor,
use count(Dimensionfield in the table) in the text object this will give the no of rows.
Or you can use the macro which i have mentioned in the above one. That macro also finds the no of rows in the particular table. After running the macro pass the "Variable" in the text box.
Regards
Sathish
Don't use macros for tasks like that, it is a major performance risk.
You need to replicate your table in the text box by using the aggr function. For example, if in your table dimension is DimA and expression is sum(value) then in the text box you need the following :
=RangeCount(aggr(sum(value), DimA))
Sometimes the count of rows is different that the count the expression returns based on certain criteria. Try it though, it may work for you.