0
Is there any way to consolidate multiple select()
#{ ---- Variables Encabezado del Proyecto ---- }#;
let projectName := first((select 'ENG WORKORDERS').'WORKORDER Name');
let totalBudget := sum((select 'WR-TASK').Budget);
let totalHours := sum((select 'WR-TASK').Hours);
#{ ---- Variables del Level 1 Areas son 2 Areas ---- }#;
let area_1_id := first(select 'WR-TASK' where Level_1 = 1).Level_1;
let area_1_budget := sum((select 'WR-TASK' where Level_1 = 1).Budget);
let area_2_id := first(select 'WR-TASK' where Level_1 = 2).Level_1;
let area_2_budget := sum((select 'WR-TASK' where Level_1 = 2).Budget);
#{ ---- Variables del Level 2 SubAreas son 3 PEP' ---- }#;
let subArea_1_id := first(select 'WR-TASK' where Level_2 = 1).Level_2;
let subArea_1_budget := sum((select 'WR-TASK' where Level_2 = 1).Budget);
let subArea_2_id := first(select 'WR-TASK' where Level_2 = 2).Level_2;
let subArea_2_budget := sum((select 'WR-TASK' where Level_2 = 2).Budget);
let subArea_3_id := first(select 'WR-TASK' where Level_2 = 3).Level_2;
let subArea_3_budget := sum((select 'WR-TASK' where Level_2 = 3).Budget);
Is there any way to consolidate multiple select()
6 Antworten
-
each result is an array, so you can use the array() command to combine arrays. But if you want to combine recId then they have to be from the same table.
Since you are using only the 'WR-TASK' DB, instead of doing a select in each line, make a new variable on line 1 that does the select then you can filter the variable as needed. Something like:
let wrtackRecs := (select 'WR-TASK'); let totalBudget := sum(wrtackRecs.Budget); let totalHours := sum(wrtackRecs.Hours); and so on....
Content aside
- vor 3 TagenZuletzt aktiv
- 6Antworten
- 39Ansichten
-
2
Folge bereits