0
Optimize code, some Help
" Se seleccionan los nombres de las SubAreas ";
let subar1 := first(select 'EAT Documentos' where SubAreas = 1).SubAreas;
let subar2 := first(select 'EAT Documentos' where SubAreas = 2).SubAreas;
let subar3 := first(select 'EAT Documentos' where SubAreas = 3).SubAreas;
" Suma por cada una de las SubAreas ";
let sa1 := sum((select 'EAT Documentos' where SubAreas = 1).Budget);
let sa2 := sum((select 'EAT Documentos' where SubAreas = 2).Budget);
let sa3 := sum((select 'EAT Documentos' where SubAreas = 3).Budget);
" Suma el total de Hotas de la SubArea ";
let totalsubarea1 := sum((select 'EAT Documentos' where Areas = 1).Budget);
let css := "
<style>
single {
font-size: medium;
text-align: center;
color: silver;
font-family: Helvetica;
}
</style>
";
let content := "
<aside class='grid-container'>
<aside class='double' style='text-align:left; font-family:Helvetica; font-size:14px; color:#d22e2e; background-color:#FFF;'>Nivel 4 SubAreas</aside>
<aside class='double' style='text-align:left; color:#ac7e60; font-size:12px; font-weight:bold;'>" +
subar1 +
" " +
"</aside>
<aside class='double' style='text-align:right; color:#ac7e60; font-size:12px; font-weight:bold;'>" +
sa1 +
" " +
"</aside>
<aside class='double' style='text-align:left; color:#ac7e60; font-size:12px; font-weight:bold;'>" +
subar2 +
" " +
"</aside>
<aside class='double' style='text-align:right; color:#ac7e60; font-size:12px; font-weight:bold;'>" +
sa2 +
" " +
"</aside>
<aside class='double' style='text-align:left; color:#ac7e60; font-size:12px; font-weight:bold;'>" +
subar3 +
" " +
"</aside>
<aside class='double' style='text-align:right; color:#ac7e60; font-size:12px; font-weight:bold;'>" +
sa3 +
" " +
"</aside>
<aside class='double' style='text-align:right; color:#d22e2e; font-size:12px; font-weight:bold;'>Total: " +
totalsubarea1 +
"</aside>
</aside>
";
html(css + content)
Is there any way to optimize this code?
I have this code on SubAreas, all budget is roll-up to Areas / IPC / Project
8 replies
-
Try doing only 1 select:
" Se seleccionan los nombres de las SubAreas "; let eatDocs := select 'EAT Documentos'; let subArea1 := eatDocs[SubAreas = 1]; let subArea2 := eatDocs[SubAreas = 2]; let subArea3 := eatDocs[SubAreas = 3]; let subar1 := first(subArea1).SubAreas; let subar2 := first(subArea2).SubAreas; let subar3 := first(subArea3).SubAreas; " Suma por cada una de las SubAreas "; let sa1 := sum((subArea1).Budget); let sa2 := sum((subArea2).Budget); let sa3 := sum((subArea3).Budget); " Suma el total de Hotas de la SubArea "; let totalsubarea1 := sum((eatDocs[Areas = 1]).Budget);
-
I imagine that the CSS area could also be optimized.
Content aside
- 2 days agoLast active
- 8Replies
- 61Views
-
2
Following