Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

A function that repeats X times

Featured Replies

Hoi

Can i make a calculation repeat?

Something like

Repeat ( Count ; Calculation )

So That Repeat ( "5" ; "2" * Count ) will give me

  • 2
  • 4
  • 6
  • 8
  • 10

It sound simple to me but i can't figure it out....

I hope somebody can help me out..

Thx

Since you have the Advanced version, you can write a recursive custom function. I am afraid I didn't understand the logic behind your example.

  • Author

Ok i'll try to explane a bit beter...

What i want is the function in the exemple to do this:

- You set the times the calculation shoot repeat by count

- And in the calculation count will count from 1 to 5

So it looks like

First run Count = 1 so 2 * 1 = 1

Second run Count = 2 so 2 * 2 = 6

third run Count = 3 so 2 * 3 = 6

Foured run Count = 4 so 2 * 4 = 8

and the fived run count = 5 so 2 * 5 = 10

Is this possible?

it's possible, but not exactly simple, because while a custom function does count the iterations, it does not reveal the count to be used in the formula. Have a look at:

http://www.briandunning.com/cf/751

It's not only possible, but the function listed above by "comment" depends upon a function called "CustomList" that does exactly what you want.

http://www.briandunning.com/cf/868

Basically, you give it a start and stop value (in your example those would be 1 and 5, respectively) and a string that should be evaluated as a calculation, with [n] holding the place of the "current count." It results in a return-delimited string with the values calculated.

So, for your scenario, you would use: CustomList ( 1 ; 5 ; "[n] * 2" )

That would result in:

2

4

6

8

10

  • Author

Super... That great. Excetly what I was looking for. Perfect

Thx

the function listed above by "comment" depends upon a function called "CustomList"

I don't think so.

  • Author

guys.. thank for the help..

I think I'm really close but i can use a bit more.. :)

I now have a calculation that go's like this:

CustomList ( 1 ; Table::CategoryCount ; "ExtractLine ( Table::CategoryList ; [n]) & " = " & ConditionalSummary ( Expenses::Category ; ExtractLine ( Table::CategoryList ; [n]) ; Expenses::Total)")

it's should give me a list of total spent per category but it gives only 1 wierd nummer

All the separate parts work but in the total something go's wrong...

CustomList ( 1 ; Table::CategoryCount ; "ExtractLine ( Table::CategoryList ; [n])") works fine and gives me a list of categories

ConditionalSummary ( Expenses::Category ; ExtractLine ( Table::CategoryList ; "2" ) ; Expenses::Total) gives me total spent of category item 2

so what's going wrong with the combination?

Thx again :worship:

it's should give me a list of total spent per category

Are you sure there isn't a simple way to produce such list - for example, a report summarized by category?

  • Author

Uhee well...

I was trying it this way because of a view things:

- I want to sell this DB to different customers.

- The Categories are in a editable value list ( so every customer can make his own list)

- This data should be on a dashboard as running totals

- and i can not create a new relationship and a new table occurrence for every category because i don't know what they are going to be

In this way i can make a list of unique categories used and find the total spent on them and use it in all the relationships i already have.

I hope this makes sense.....

Thank again

It's not necessary (or smart) to have a relationship for every category. You should have a table of Categories and let each category summarize the related expenses using a single relationship to the Expenses table.

  • Author

I understand what u mean but I did not want a new table only for the categories. And I think it's more eazy for the user to edit a value list than a table.

But I'll have a other look at it. In the meantime. How knows what's wrong with the formula above?

Any help would be super cool

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.