Jump to content
Server Maintenance This Week. ×

A function that repeats X times


This topic is 4229 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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:

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This topic is 4229 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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