Getting Dashboard Stats, Lazy way

Sometimes we build very heavy dashboards, and then we have to gather stats like DataTable count, row count etc.
Or, we need to get the stats for analysis developed by someone else (boring ?? Yeah....)
I use below for such situations -

dc=0

rc=0

for t in Document.Data.Tables:

    print t.Name," ", t.RowCount

    dc=dc+1

    rc=rc+t.RowCount

print "DataTables ", dc

print "Total Rows ", rc
Share:

Ignore Hierarchy in Cross Table Sorting - through IronPython

You know how to Ignore Hierarchy while sorting a Cross Table (If you don't, this might help you).
Question : But, How to do that pragmatically ?
Answer   : Use the code below

from Spotfire.Dxp.Application.Visuals import *
from Spotfire.Dxp.Data import SortOrder

v = v.As[Visualization]()

if v.SortRowsMode == CrossTablePlot.SortMode.Global :
 v.SortRowsMode = CrossTablePlot.SortMode.Leaf
else :
 v.SortRowsMode = CrossTablePlot.SortMode.Global
Share: