0

Calculate an amount based on a Number field and a Multiple Choice field

Context.  Trying to populate a table of days of the month from a 'Costs' table that has known costs of the business.

Costs table:

costs

Day is a number field. Months is a multichoice field:

months

Table looks like:

table

Over in my Cashflow table I have a button that I want to populate a sub-table e.g.:

cashflow

What I want to do is:

Loop through the days for that months 'Daily Cash' table:

  Loop thorugh the items in the 'Costs' table:

     sum up the Costs field [if the days match] and [if the month is selected in the multichoice field]

 

So the looping bit is fine, summing up the costs based on the [days matching] is fine....   but how do I work out if my month is included in the multichoice field?

Completely stumped!!!

1 reply

null
    • Customer Service Ninox
    • Maria_pasini
    • 3 yrs ago
    • Reported - view

    Hello Jason
    In order to see if the month is included in the multichoice field, you would need to transform the month into a text field (1>Jan, 2>feb, 3>mar...), and then search with the statement like : Months (multi field) like xMonth (Variable that writes the month in text)

    So it would look something like this:

    Loop through the days for that months 'Daily Cash' table:
      Loop thorugh the items in the 'Costs' table:
         let xMonth:= if month(Date)=1 then "Jan" else if month(Date)=2 then "Feb" else.....
         sum up the Costs field [if the days match] and [Months like xMonth]

Content aside

  • 3 yrs agoLast active
  • 1Replies
  • 715Views