我正在尝试在python中进行“切换”,该代码处于打开状态的函数将无限循环,并且我想进行切换,以便在满足条件时不会对其进行重新检查。
我尝试将def selected():放到循环函数之外并调用它,但它不会运行。
//capture the dates selected in the where clause of the query
CREATE DYNAMIC SET CURRENTCUBE.SelectedDates as
[Dim Date].[Date].[Date].Members;
CREATE MEMBER CURRENTCUBE.[Measures].[Cumulative Sale Price] as
Sum(
{
SelectedDates.Item(0).Item(0)
:
Tail(Existing [Dim Date].[Date].[Date].Members, 1).Item(0).Item(0) //capture the last date present in the Filter context for this cell
},
[Measures].[Sale Price]
);
CREATE MEMBER CURRENTCUBE.[Measures].[Cumulative Sale Price with Skips] as
Sum(
Exists(
SelectedDates,
{
SelectedDates.Item(0).Item(0)
:
Tail(Existing [Dim Date].[Date].[Date].Members, 1).Item(0).Item(0) //capture the last date present in the Filter context for this cell
}
),
[Measures].[Sale Price]
);
我希望它可以像电灯开关一样工作,但是它就像按钮一样,只有在按下时才能工作。