Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello friends,
How to convert front end chart expression in back end script for below mentioned expression.
=Sales/Sum(TOTAL{1} Sales)
I have a material and sales fields now i have to create a field called 'percentage of total sales '. In the front end chat above expression is working fine, but i want this expression move to back end script.
OUTPUT column | ||
Material | Sales | sales/sum(sales) |
1 | 10 | 10/129 =0.77519 |
2 | 13 | |
3 | 20 | |
4 | 5 | |
5 | 15 | |
6 | 66 | |
Total | 129 |
Thanks,
Venkat
Try this
Table:
LOAD * INLINE [
Material, Sales
1, 10
2, 13
3, 20
4, 5
5, 15
6, 66
];
Left Join (Table)
LOAD Sum(Sales) as TotalSales
Resident Table;
FinalTable:
LOAD *,
Sales/TotalSales as [percentage of total sales]
Resident Table;
DROP Table Table;
Try this
Table:
LOAD * INLINE [
Material, Sales
1, 10
2, 13
3, 20
4, 5
5, 15
6, 66
];
Left Join (Table)
LOAD Sum(Sales) as TotalSales
Resident Table;
FinalTable:
LOAD *,
Sales/TotalSales as [percentage of total sales]
Resident Table;
DROP Table Table;
Excellent, it works fine
Hi @sunny_talwar ,
I need something similar, but I want to choose maximum value. This is my case: I have number of days- this is summarized value from script for each id sum(day)= Number of days and I need max value from it ( 362) in script.
Do you know how to deal with it?
Thanks