tijnisfijn Posted September 26, 2012 Posted September 26, 2012 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
comment Posted September 26, 2012 Posted September 26, 2012 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.
tijnisfijn Posted September 26, 2012 Author Posted September 26, 2012 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?
comment Posted September 26, 2012 Posted September 26, 2012 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
DanShockley Posted September 26, 2012 Posted September 26, 2012 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
tijnisfijn Posted September 26, 2012 Author Posted September 26, 2012 Super... That great. Excetly what I was looking for. Perfect Thx
comment Posted September 26, 2012 Posted September 26, 2012 the function listed above by "comment" depends upon a function called "CustomList" I don't think so.
tijnisfijn Posted September 27, 2012 Author Posted September 27, 2012 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:
comment Posted September 27, 2012 Posted September 27, 2012 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?
tijnisfijn Posted September 27, 2012 Author Posted September 27, 2012 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
comment Posted September 27, 2012 Posted September 27, 2012 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.
tijnisfijn Posted September 27, 2012 Author Posted September 27, 2012 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
Recommended Posts
This topic is 4450 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 accountSign in
Already have an account? Sign in here.
Sign In Now