如何在 Tableau 中将一段时间内的累积总计值转换为实际每日值?
我正在处理累积数据集,需要将累积值转换为同一列的每日值。 我通过创建计算字段来做到这一点,但是第一行的值丢失了。因为第一行没有前一行。我需要以一种让第一行拥有自己的值的方式编写代码。 我的代码是这样的:
ZN(SUM([地面武器总数])) - LOOKUP(ZN(SUM([地面武器总数])), -1)
I am working on a cumulative dataset and I need to convert cumulative values to daily values of the same column.
I did it with creating a calculated field, but, the first row's value is missed. Because there is no previous row for the first row. I need to write the code in a way that lets the first row by it's own value.
my Code is this :
ZN(SUM([Total Ground Weapons])) - LOOKUP(ZN(SUM([Total Ground Weapons])), -1)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Samkart 大致上倾向于正确的方向,尽管我可能会使用使用 Index() 而不是 First() 的逻辑语句 First(
)、Last() 和 Index() 都是行排序器:
因此,对于您的计算,我将测试:
这样,您将能够为集合中的第一个条目定义一个值。
史蒂夫
Samkart is broadly leaning in the correct direction, though I'd probably go with a logic statement that utilises Index() rather than First()
First(), Last() and Index() are all row sequencers:
So for your calculation I'd test:
This way, you'll be able to define a value for the first entry in your set.
Steve