How about ranking? Why would you want to count rows in a PP report? If it's for determining the number of clients (for example), then you could use the category count function inside of Transformer.
Plus the advantage of the "rank" window in PP Client is that it shows you the number of rows in the "Show Ordinals" section (the grayed out figure) without having to proceed with the ranking.
If that's too much effort for your user, it should be possible to code a macro that counted rows (or columns) of the current report.
lex
Following on from the last post, here's a simple macro that uses the count property. Since the property will include totals for Explorer reports in the count, there is a test for the mode to adjust.
'* This macro requires an active PowerPlay report.
Option Explicit
Sub Main
Dim objPPRep As Object
Dim strErrorText As String
Dim ColumnCount As Integer
Dim RowCount As Integer
Dim test
On Error GoTo ErrorMes
Set objPPRep = GetObject(,"CognosPowerPlay.Report")
Test = objPPRep.ExplorerMode
ColumnCount = objPPRep.Columns.Count
RowCount = objPPRep.Rows.Count
If test = -1 then ColumnCount = ColumnCount -1
If test = -1 then RowCount = RowCount -1
MsgBox "The open report has " & ColumnCount & " columns and " & _
RowCount & " rows."
done:
Exit Sub
ErrorMes:
strErrorText = "The following error occurred at line " & Erl & "." & _
Chr$(13) & Chr$(13) & Chr$(9) & Err & " " & Error
If Err = 429 Then
MsgBox strErrorText & Chr$(13) & Chr$(13) & "Please ensure that " & _
"a PowerPlay report is active before running the macro."
Else
MsgBox strErrorText
End If
Resume done
Create a "calculated" column in your .imr (that you save as an .iqd) report called "NBR". Make it a 'number' value of 1.
Use the column "NBR" as a measure.
It will be the count of the number of rows for that related dimension/category in your cube.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.