Formula in Netsuite Saved Search

笑着哭i 提交于 2019-12-31 03:46:07

问题


I have a problem here. In Column 1 I have count of All he transaction, In column 2 I have Count of transaction of specific status. In column 3 I want the percentage of above 2; like count of specific transaction/Count of total. Is it possible in Netsuite?


回答1:


Actually there is an interesting feature that makes this possible. Formula fields that have aggregate functions work when the row has an aggregate on it. So for instance if you wanted to see a percentage of orders with status Billed on a Sales Order search you would enter a Formula (Percent) result with a formula like:

sum(case when {status} = 'Billed' then 1 else 0 end) / count({tranid})

and apply an aggregate to that column. The sample uses Maximum but Minimum and Average produce the same result.




回答2:


I think that isn't possible by just saved search.

You will have to group on search result column status, so, all the count total will be based on statuses and you can't write aggregation based on other search results' columns.

you can further write a suitelet/portlet script to use the saved search result and calculate the stats before presenting on UI.



来源:https://stackoverflow.com/questions/34020104/formula-in-netsuite-saved-search

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!