Reputation: 1
I would like to create a Saved Search in NetSuite that returns the percentage of Quotation in a specific month. I have achieved month wise count of quotation and in summary total is also showing as a year, I want to calculate monthly percentage based yearly total in another column. enter image description here enter image description here
Upvotes: 0
Views: 1057
Reputation: 1270
I'm afraid the only way to do this is Client side.
if (!window.hereFirst) {
window.hereFirst = true;
window.addEventListener(`load`, (e) => {
let rcs = Array.from(document.querySelectorAll(`[row-count]`));
let tc = rcs.reduce((t, r) => t + Number(r.getAttribute(`row-count`)), 0);
rcs.forEach(r => {
let rp = r.parentElement;
rp.textContent = ((Number(r.getAttribute(`row-count`)) / tc) * 100)
.toFixed(1) + `%`;
rp.classList.add(`listtextrt`);
});
});
}
this goes into an html image onload event.
and produces
Minimum of Formula (Text):
'<img style="display: none;" row-count="'||COUNT(DISTINCT {number})||'" src="/core/media/media.nl?id=#&c=#&h=..." onload="if (!window.hereFirst) { window.hereFirst = true; window.addEventListener(`load`,(e) => { let rcs = Array.from(document.querySelectorAll(`[row-count]`)); let tc = rcs.reduce((t,r) => t+Number(r.getAttribute(`row-count`)),0); rcs.forEach(r => { let rp = r.parentElement; rp.textContent = ((Number(r.getAttribute(`row-count`))/tc)*100).toFixed(1)+`%`; rp.classList.add(`listtextrt`); }); }); }">'
I use my company's logo for the image since the browser is already loading and caching it.
Upvotes: 0