Shobhit Sachdeva Posted June 11, 2019 Posted June 11, 2019 Hi, I need to sort the summary table with the aggregation column that is added in the summary table. I have the below code that I have written , the table has few aggegation methds that have been added and it needs to sorted in descending order with stddev, Code: ## SUMMARY TABLE viz = Application.Document.ActivePageReference.Visuals.AddNew[summaryTable]() dataTable = Document.Data.Tables["FETCH_ALARM_TEMPLATE_VI"] viz.Data.DataTableReference=dataTable viz.Title = SignalName+"_"+StatisticName viz.CategoryAxis.Expression = "" viz.Aggregations.AddNew("Count") viz.Aggregations.AddNew("Min") viz.Aggregations.AddNew("Max") viz.Aggregations.AddNew("Median") viz.Aggregations.AddNew("StdDev") viz.Columns.AddNew("SPC_VALUE") viz.SortColumns.Set(dataTable.Aggregations.Item["StdDev"],SortOrder.Descending) ## THIS DOES NOT WORK viz.Legend.Visible = False I think this is the api -https://docs.tibco.com/pub/doc_remote/sfire_dev/area/doc/api/TIB_sfire-analyst_api/html/M_Spotfire_Dxp_Application_Visuals_SummaryTableSortColumnCollection_Set.htm I am not sure of the syntax for the first parameter. I need to sort on StdDev. Please advise. Thanks.
Shobhit Sachdeva Posted June 11, 2019 Author Posted June 11, 2019 works like this: ## SUMMARY TABLE viz = Application.Document.ActivePageReference.Visuals.AddNew[summaryTable]() dataTable = Document.Data.Tables["FETCH_ALARM_TEMPLATE_VI"] viz.Data.DataTableReference=dataTable viz.Title = SignalName+"_"+StatisticName viz.CategoryAxis.Expression = "" viz.Aggregations.AddNew("Count") viz.Aggregations.AddNew("Min") viz.Aggregations.AddNew("Max") viz.Aggregations.AddNew("Median") column=viz.Aggregations.AddNew("StdDev") viz.Columns.AddNew("SPC_VALUE") viz.SortColumns.Set(column,SortOrder.Descending) viz.Legend.Visible = False viz.Data.WhereClauseExpression = "[sIGNAL]='" + SignalName + "' AND [sTATISTIC] = '" + StatisticName +"'"
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now