[Sales] + [Profit] 将变为 ZN( [Sales] ) + ZN( [Profit] )SUM( [Sales] ) + SUM( [Profit] ) 将变为 ZN( SUM( [Sales] )) + ZN( SUM( [Profit] ))[Region] = NULL 将变为 ISNULL( [Region] )IF [Region] = "North Pole" THEN [Sales] END
IF [Region] = "Central"
THEN [Sales]
ENDIF [Region] = "North Pole"
THEN [Sales]
ELSE 0
ENDIF [Region] = "Central" THEN [Sales] END - IF [Region] = "West" THEN [Sales] END
SUM( IF [Region] = "Central" THEN [Sales] END ) - SUM( IF [Region] = "West" THEN [Sales] END )
注意:如果条件语句中使用的任何维度包括在视图中,则此选项将不起作用。如果视图中包括“[Region]”(区域),上面的示例将不起作用。
{ FIXED : SUM( IF [Region] = "Central" THEN [Sales] END ) }
-
{ FIXED : SUM( IF [Region] = "West" THEN [Sales] END ) }
注意:可能必须将视图中的维度添加到上面的计算中(放在 FIXED 后面)。
WINDOW_SUM( SUM( IF [Region] = "Central" THEN [Sales] END )) - WINDOW_SUM( SUM( IF [Region] = "West" THEN [Sales] END ))有关使用表函数的另一个示例,请参见计算视图中相同度量的两个值之间的差异。
FLOAT( [Price] )FLOAT( RIGHT( [Price], LEN( [Price] ) - 1 ))FLOAT(
IF ISNULL( FLOAT( LEFT( [Price],1 )))
THEN RIGHT( [Price], LEN( [Price] ) - 1 )
ELSE [Price]
END001474028

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.