0

Kumulative Hours for Diagram on Chart table

I have the Cumulative Hours by 'Year Month' field  On the View Cumulative Hours, now I need adapt this formula on the botton 'ADD info Dates' for View on Chart table the Cumulative Hours by Months.

Thanks

6 Antworten

null
    • Rafael_Sanchis
    • vor 7 Monaten
    • Gemeldet - anzeigen

    Ready, more easy I thinked

    let xResponse := dialog(" ⛔️ Warning", "Are you sure to delete all Records on Evaluation table?", ["YES", "CANCEL"]);
    if xResponse = "YES" then
        delete (select Graph)
    end;
    sleep(500);
    let myY := year(Start_Day);
    let myYM := yearmonth(Start_Day);
    let datOrder := (select 'Main Data' where yearmonth('▶︎ DateFinalYear') >= myYM);
    let myHours := sum(select 'Main Data').Hours;
    for fY in range(myY, year(today()) + 1) do
        let myArray := for fM in range(1, 13) do
                sum(datOrder[year(Finish_Day) = fY and month(Finish_Day) = fM].Hours)
            end;
        let newRec := (create Graph);
        newRec.(
            Year := fY;
            Jan := item(myArray, 0);
            Feb := item(myArray, 1);
            Mar := item(myArray, 2);
            Apr := item(myArray, 3);
            May := item(myArray, 4);
            Jun := item(myArray, 5);
            Jul := item(myArray, 6);
            Aug := item(myArray, 7);
            Sep := item(myArray, 8);
            Oct := item(myArray, 9);
            Nov := item(myArray, 10);
            Dec := item(myArray, 11)
        );
        openRecord(newRec)
    end
    
      • Rafael_Sanchis
      • vor 6 Monaten
      • Gemeldet - anzeigen

       

      How can I modify this script for work in WeekDays all fridays ? Is possible

      • Rafael_Sanchis
      • vor 6 Monaten
      • Gemeldet - anzeigen

       

      let xResponse := dialog(" ⚠️ WARNING ", "Are you sure to delete all Records on Graph table?", ["YES", "CANCEL"]);
      if xResponse = "YES" then
        delete(select 'Acumulative Graph');
      end;
      sleep(500);
      let myY := year('Order date');
      let weekNumber := week('Order date');
      let datOrder := (select 'Orders by Clients' where year('▶︎ DateFiscalYear') >= myY);
      let myCost := sum(select 'Orders by Clients').'Total gross price';
      for fY in range(myY, year(today()) + 1) do
        let myArray := [];
        for fW in range(1, 53) do
          let weekSum := sum(datOrder[week('Order date') = fW and year('Order date') = fY].'Total gross price');
          myArray.(weekSum);
        end;
        let newRec := (create 'Acumulative Graph');
        newRec.(
          Year := fY;
          Week1 := item(myArray, 0);
          Week2 := item(myArray, 1);
          Week3 := item(myArray, 2);
          Week4 := item(myArray, 3);
        );
        openRecord(newRec)
      end
      

      I have problem on line 14

      • mirko3
      • vor 6 Monaten
      • Gemeldet - anzeigen

       try in line 14 

      myArray:=array(myArray,[weekSum]);
    • mirko3
    • vor 7 Monaten
    • Gemeldet - anzeigen

    Hi, Rafael. This could be another solution to your problem. Check it out. Mirko

      • Rafael_Sanchis
      • vor 7 Monaten
      • Gemeldet - anzeigen

       

      👍Thanks Mirko

Content aside

  • Status Answered
  • vor 6 MonatenZuletzt aktiv
  • 6Antworten
  • 73Ansichten
  • 2 Folge bereits