简体   繁体   English

如何在自定义表达式中引用Spotfire中的轴

[英]How to refer to axis in Spotfire in custom expression

This is going to sound ridiculous, but I'm really struggling to follow along with the examples in Spotfire 6.5: 这听起来很荒谬,但我真的很难跟上Spotfire 6.5中的例子:

I have a line chart, where I'm trying to produce a cumulative sum of sales. 我有一个折线图,我试图产生累计销售额。 I have dates on the x-axis, correctly identified as DateTime format in Spotfire, and volumes on the y-axis. 我在x轴上有日期,在Spotfire中正确识别为DateTime格式,在y轴上有卷。

I have the custom expression: 我有自定义表达式:

Sum([volume]) then Sum([Value]) over (AllPrevious([Axis.X]))

... but I get an error message saying "Could not find axis: 'X'" in the visualization. ...但是在可视化中我收到一条错误消息,提示“找不到轴:'X'”。

Interestingly the UI on the y-axis selector has changed to read "Cumulative Sum (volume)", so I think I must be close... It's just the final hurdle to get over!! 有趣的是,y轴选择器上的UI已更改为显示“累积总和(体积)”,所以我认为我必须接近……这是克服困难的最后障碍!

To be completely explicit about this: Should I be using [Axis.X] in my expression, or something like [Date] ? 对此进行明确说明:我应该在表达式中使用[Axis.X]还是类似[Date]东西?

The data looks like this: 数据如下所示:

Dates       Sales Cumulative sales

2001-01-09  10    10
2002-01-09  20    30
2003-01-09  30    60
2004-01-09  40    100
2005-01-09  50    150

and the expression for 'Cumulative sales' is: Sum([Sales]) OVER (AllPrevious([Dates])) 并且“累计销售额”的表达式为:Sum([Sales])OVER(AllPrevious([Dates]))

Is it what you are looking for ? 这是你在找什么?

Sounds like your X axis isn't categorical, but continuous. 听起来您的X轴不是绝对的,而是连续的。 In that case the axis won't be available for an OVER expression. 在这种情况下,轴将无法用于OVER表达式。 Your Y axis expression looks correct. 您的Y轴表达式看起来正确。

If you right-click the x axis expression and select "Custom Expression...", the expression for the axis needs to begin with '<' and end with'>'. 如果右键单击x轴表达式并选择“自定义表达式...”,则轴的表达式需要以“<”开头,并以“>”结尾。 This means Spotfire will treat values as categories, rather than as measures on a continuous scale. 这意味着Spotfire会将值视为类别,而不是连续规模的度量。 You can also see this by going to X-Axis property page -> Settings button 您还可以通过转到X轴属性页面->设置按钮来查看此内容

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM