0

Is it possible to add a condition at the beginning of the table?

I am using concat here to display the data from (invoiceitems.‘1 or 2’). Is it possible to use conditional statements in the code, for example: if it returns 1, then display 0; otherwise, keep it unchanged. If it previously returned 1, 2, 1, 2, then it should now return 0, 2, 0, 2.

6 replies

null
    • Fred
    • 5 mths ago
    • Reported - view

    It would be easier to write a new formula field in the invoiceitems table that does checking. Then you can just reference the new field in your column.

      • gold_cat
      • 5 mths ago
      • Reported - view

       Yes, you're right. I was just trying to have the data displayed only in the table, with fewer formula fields created. But it seems that's not possible.

      • Fred
      • 5 mths ago
      • Reported - view

      It is possible to do it in the column formula, just easier as a formula field.

      • gold_cat
      • 5 mths ago
      • Reported - view

       Thanks for the reply 

      • Fred
      • 5 mths ago
      • Reported - view

      Sorry for not providing a possible solution to your question. You can do something like this in your column formula:

      let x := invoiceitems;
      let y := for loop1 in x do
              if loop1.'1 or 2' = 1 then 0 else loop1.'1 or 2' end
          end;
      concat(y)
      
      • gold_cat
      • 5 mths ago
      • Reported - view

       Thank you, Fred. This saves me from creating too many formula windows.

Content aside

  • Status Answered
  • 5 mths agoLast active
  • 6Replies
  • 49Views
  • 2 Following