0

Unique values - or Group by YearWeek

I have a Multiple Choice Dynamics, select the info from 'History Chanels',  but need a unique values

There are ant way?

9 Antworten

null
    • mirko3
    • vor 1 Jahr
    • Gemeldet - anzeigen

    Hi Rafael. Try this.

    let uni := unique((select 'History Hours' order by yw).yw);
    for i in uni do
        first((select 'History Hours')[yw = i])
    end
    
      • Rafael_Sanchis
      • vor 1 Jahr
      • Gemeldet - anzeigen

      Mirko Hi Mirko , sorry for so much inconvenience.

       

      Yes your  formula work good, now the right fórmula don't display good the data 😐.

      2023/22 60 Hours will be the correct display.

      2023/23 66 Hours will be the corect display.

      • mirko3
      • vor 1 Jahr
      • Gemeldet - anzeigen

      If you need the sum of hours in a yearweek, than try this:

      let tab := select 'History Hours';
      let yweeks := for i in numbers(MDc) do
              first((tab order by yw)[number(Nr) = i]).yw
          end;
      let result := for j in yweeks do
          j + " " + sum((select tab)[yw = j].'Hours')
      end;
      join(result,"
      ")
      
      • Rafael_Sanchis
      • vor 1 Jahr
      • Gemeldet - anzeigen

      Mirko on line 3 give error (Nr) ? 

    • mirko3
    • vor 1 Jahr
    • Gemeldet - anzeigen

    ...or this

    let yweeks := for i in numbers(MDc) do
            first(((select 'History Hours') order by yw)[number(Nr) = i]).yw
        end;
    let result := for j in yweeks do
            j + " " + (select 'History Hours')[yw = j].'Hours:'
        end;
    join(result, "
    ")
    
      • Rafael_Sanchis
      • vor 1 Jahr
      • Gemeldet - anzeigen

       😪 again problems now on line 2 the same error.

      number(Nr) field nit found (Ne) what is this. Mirko  

      • mirko3
      • vor 1 Jahr
      • Gemeldet - anzeigen

      is it the same table I already know, or did you change it? My result ist possible.

      • Rafael_Sanchis
      • vor 1 Jahr
      • Gemeldet - anzeigen

      Yes is the same table.

      only delete data and place new data the structure is the same.

      is on History Hours table in second tab.

      • mirko3
      • vor 1 Jahr
      • Gemeldet - anzeigen