0

Formula to Count item per Week

Hi 

I Need a Formula to count the amount of 'Rev A' per Week

Example Week 15 - 3 

                Week 16 - 1  

8 replies

null
    • Fred
    • 11 mths ago
    • Reported - view

    How will you be displaying the data?

    In a view element?

    In a formula field that shows text?

    In a formula field that is using another field that has the week number?

    The main question is how will you tell the formula to count this many records with a particular week number?

      • Rafael Sanchis
      • Rafael_Sanchis
      • 11 mths ago
      • Reported - view

      Fred 

      I wiill like to show in formula field that show text.

      count Rev A by week. 

      On week 15 , 3 rev A release

      On week 16, 1 rev A release 

      • Rafael Sanchis
      • Rafael_Sanchis
      • 11 mths ago
      • Reported - view

      Fred The Issues (Rev A),  occur only one in the entire life of project, like the other issues.

    • Fred
    • 11 mths ago
    • Reported - view

    The following code assumes you are in the same table as the reference field 'Issues A':

    let listofWeeks := sort(unique('Issues A'.Week));
    let crtn := urlDecode("%0A");
    let display := for loop1 in listofWeeks do
            "Week " + loop1 + " - " + count('Issues A'[Week = loop1])
        end;
    join(display, crtn)
    

    Line 1: creates a unique list of the data in the field Week from the reference field 'Issues A' then sorts them in numerical order.

    Line 2: creates a variable with a carriage return to be used later.

    Lines 3 - 5: creates a variable to store the counting of each instance that was found in line 1.

    Line 6: uses the join() command to arrange each instance of the loop in the display variable with a carriage return.

      • Rafael Sanchis
      • Rafael_Sanchis
      • 11 mths ago
      • Reported - view

      Fred 👍great Fred, as always everything works great. Excelente Explanación.

      Appreciate your help.

      • Rafael Sanchis
      • Rafael_Sanchis
      • 11 mths ago
      • Reported - view

      Fred 

      let listofWeeks := sort(unique('Issues A'.Week));
      let crtn := urlDecode("%0A");
      let display := "";
      let totalCount := 0;
      for loop1 in listofWeeks do
          let count := count('Issues A'[Week = loop1]);
          let weekString := "Week " + loop1 + " - " + count;
          display := display + weekString + crtn;
          totalCount := totalCount + count
      end;
      let totalString := "Total Issues: " + totalCount;
      display := display + totalString;
      display
      

      Add some lines for Add a total issues👍

      • Rafael Sanchis
      • Rafael_Sanchis
      • 11 mths ago
      • Reported - view

      Fred

      Hi Fred one question there are any way to place the Total Issues: one line down, and most right

      • Fred
      • 11 mths ago
      • Reported - view

      Rafael add another crtn between display and totalString?

      I'm not sure what you want to do with "most right", but if you want finer control of the text then you probably have to look into using html.

Content aside

  • Status Answered
  • 11 mths agoLast active
  • 8Replies
  • 103Views
  • 2 Following