简体   繁体   English

Netsuite-带天数计算公式的保存搜索

[英]Netsuite - Saved Search with Days Calculation Formula

![enter image description here][1]I am trying to create a Saved Search in Netsuite that calculates the number of days between two dates in a summarized search. ![在此处输入图片描述] [1]我正在尝试在Netsuite中创建一个“保存的搜索”,以计算摘要搜索中两个日期之间的天数。 I am attaching a screenshot of the Results tab for reference. 我附上“结果”标签的屏幕快照,以供参考。 I have tried using a Numeric Formula field, as well as a Date/Time Formula field. 我尝试使用数字公式字段以及日期/时间公式字段。 I have also tried every Summary Type available. 我还尝试了每种可用的摘要类型。 Is there another way to do this? 还有另一种方法吗? I just get an entire blank column when I run this. 运行此命令时,我只会得到整个空白列。

As some background, I am trying to calculate how many days between when the system note was changed to Pending Accounting to when the system note was changed to Processed. 作为某些背景,我试图计算从系统注释更改为“待处理会计”到系统注释更改为“已处理”之间的间隔天数。

Thanks! 谢谢!

Update: It won't let me upload photos. 更新:它不会让我上传照片。 Here is the formula I am using: 这是我使用的公式:

(CASE WHEN {systemnotes.newvalue}
= 'Processed'THEN {systemnotes.date} END)-(CASE WHEN {systemnotes.newvalue}
='Pending Accounting'THEN {systemnotes.date} END)

I'm not sure you are going to be able to evaluate this. 我不确定您是否可以对此进行评估。

systemnotes.value can only have one value at each cell, which means that you can't have it be equal to Processed and Pending Accounting at the same time. systemnotes.value在每个单元格中只能有一个值,这意味着您不能同时使它等于“已处理”和“待处理”。

What you do in this case is something along the lines of 在这种情况下,您要做的是

CASE WHEN {systemnotes.newvalue}= 'Processed' 
THEN TO_DATE({systemnotes.date}) 
ELSEIF {systemnotes.newvalue}='Pending Accounting' 
THEN TO_DATE({systemnotes.date})*-1 
ELSE 0 
END

And then do a sum on the whole thing. 然后对整个事情做个总结。 I'm pretty sure this won't work as this is not tested, but the idea is to declare on each cell the positive, negative or null value, and then add make NS add the whole column to summarise. 我很确定这是行不通的,因为未经测试,但是我们的想法是在每个单元格上声明正值,负值或null值,然后添加make NS将整个列添加到摘要中。

Also you might find issues for duplicate values so if the state goes back to a previous state you might get weird results. 另外,您可能会发现重复值的问题,因此,如果状态返回到先前的状态,则可能会得到奇怪的结果。

Edit- see if you can find something to work with unix time, that might make life easier. 编辑-查看您是否可以找到一些可以在Unix上使用的东西,这可能会使生活更轻松。

See reference for oracle sql: http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions001.htm 请参见有关oracle sql的参考: http : //docs.oracle.com/cd/B19306_01/server.102/b14200/functions001.htm

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

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