简体   繁体   English

如何根据日期差异为Spotfire表格单元着色

[英]How to color a Spotfire Table cell based on a date difference

I'm using a Spotfire Table visualization to display a list of engineering reports. 我正在使用Spotfire Table可视化来显示工程报告列表。 One of the columns reports the last time the report was updated (Last_Update). 其中一列报告上次更新报告的时间(Last_Update)。 The column data type is DateTime and is formatted as mm/dd/yyyy. 列数据类型是DateTime,格式为mm / dd / yyyy。

I'm trying to color/shade the cell based on the difference between Last_Update and today's date. 我正在尝试根据Last_Update和今天的日期之间的差异对单元格进行着色/着色。 For example: Last_Update - TodaysDate = 65 would color the cell red. 例如:Last_Update - TodaysDate = 65会将单元格着色为红色。 I'm open to using gradient or segment color schemes. 我愿意使用渐变或分段颜色方案。

I've tried a number of ways (custom expressions in the Colors menu, referencing the value of an associated column already having the aforementioned calculation, etc.) and keep running into walls. 我尝试了很多方法( 颜色菜单中的自定义表达式,引用已经具有上述计算的关联列的值等)并继续运行到墙上。

Are there any suggestions about how to simply achieve this? 关于如何简单地实现这一点有什么建议吗?

Do you need it to be Gradient of segment? 你需要它是分段的渐变吗?

You could used fixed mode and add Boolean expression rule like 您可以使用固定模式并添加布尔表达式规则

Datediff('dd', [Last Update], DateTimeNow()) = 65

If you need ranges you can build them easily 如果您需要范围,可以轻松构建它们

Datediff('dd', [Last Update], DateTimeNow()) < 65 AND Datediff('dd', [Last Update], DateTimeNow()) > 20

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

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