Remove the repeated values from CutOff
Hi all again
Starting from CutOff Date I need to remove the repeated values, In the picture the case, as CutOff Date 31/March/2023, eliminate the values of Real and Cumulative Cost down from 07/April/2023 to end Finish CutOff Date
CutOff Date is every 7 days Friday to Friday.
Is possible with a Button script ?
In this example is only few items but on some projects maybe a lot values.
11 replies
-
No ideas
-
How are these duplicate records created? Can you "fix" the problem before it happens?
-
Rafael said:
Repeats from the cut-off date 7 Apr 2023 (Real, Cumulative Cost and Earned Hours)It looks like the 7 Apr and later records have no data for Gasto Semana. Can you use that to limit the record creation? Maybe something like?
for loop1 in select CutOff where 'Gasto Semana' != 0 do
Also you can move the let xPry to outside the loop so you don’t do the select over and over. You can do this since you don’t do anything but gather the first record from the Project table.
let xPry := first(select Project); let check := dialog(" Warning ", " ¿Confirm the Update Progress Project? ", ["Yes", "No"]); if check = "Yes" then for loop1 in select CutOff do CutOff_ := loop1.DateCO;
-
let check := dialog(" Warning ", " ¿Confirm the Update Progress Project? ", ["Yes", "No"]); if check = "Yes" then for loop1 in select CutOff do CutOff_ := loop1.DateCO; let xPry := first(select Project); let xFld0 := xPry.'% Plan'; let xFld1 := xPry.'% Earned'; let xFld2 := xPry.'Data|Date'; let xFld3 := xPry.Week; let xFld4 := xPry.'Plan Value PV'; let xFld5 := xPry.'Earned Value EV'; let xFld6 := xPry.'Cost Week'; let xFld7 := xPry.SPI; let xFld8 := xPry.CPI; let xFld9 := xPry.'Plan Hours'; let xFld10 := xPry.'Earned Hours'; let Pgr := (create 'Progress Report'); Pgr.(Plan := if cnt((select 'Progress Report')[Plan=xFld0]) > 0 then null else xFld0 end); Pgr.(Real := if cnt((select 'Progress Report')[Real=xFld1]) > 0 then null else xFld1 end); Pgr.('Date CutOff' := xFld2); Pgr.('Week CutOff' := xFld3); Pgr.('Total Earned Plan' := xFld4); Pgr.('Total Earned Real' := xFld5); Pgr.('Gasto Semana' := xFld6); Pgr.(SPI := xFld7); Pgr.(CPI := xFld8); Pgr.(Plan_Hours := xFld9); Pgr.(Earned_Hours := xFld10) end else closeRecord() end
Try this in your button.
I just look for the fields Real and Plan as you can see, but you can expand it for other fields aswell. (Maybe wrapping the whole in a 'do as server' would make things more faster)
Content aside
- Status Answered
- 1 yr agoLast active
- 11Replies
- 142Views
-
3
Following