Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/go/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sorting Spotfire 7->;如何使用Iron Python对列表对象应用自定义排序顺序_Sorting_Ironpython_Spotfire - Fatal编程技术网

Sorting Spotfire 7->;如何使用Iron Python对列表对象应用自定义排序顺序

Sorting Spotfire 7->;如何使用Iron Python对列表对象应用自定义排序顺序,sorting,ironpython,spotfire,Sorting,Ironpython,Spotfire,SpotFire7->如何在SpotFire7中使用Iron Python对列表对象应用自定义排序顺序?我使用document.properties[“Columns”]列表在运行时填充交叉表的列。在将列表值分配给交叉表可视化的列之前,我想在此列表上应用自定义排序顺序。请参阅以下参考: 以下是创建反向自定义排序顺序的示例: from System.Reflection import Assembly from Spotfire.Dxp.Data.Collections import *

SpotFire7->如何在SpotFire7中使用Iron Python对列表对象应用自定义排序顺序?我使用document.properties[“Columns”]列表在运行时填充交叉表的列。在将列表值分配给交叉表可视化的列之前,我想在此列表上应用自定义排序顺序。请参阅以下参考:

以下是创建反向自定义排序顺序的示例:

from System.Reflection import Assembly 
from Spotfire.Dxp.Data.Collections import *
from System.Runtime.Serialization import ISerializable
from System.Collections import IComparer
from System.Collections.Generic import IComparer

values = Document.Data.Tables['MY_DATA_TABLE'].Columns['DATE'].RowValues.GetEnumerator()
myValues = []
for val in values:
                myValues.Add(val.ValidValue)
                myValues.sort(reverse=True)
Document.Data.Tables['MY_DATA_TABLE'].Columns['DATE'].Properties.SetCustomSortOrder(myValues)