Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

Hi this is a two part question.

1. How do repeating calculations exactly work. I dont understand them

2. If I have a global calculation field that shows the direction of a sort, asc / desc arrows, and I want to show it for a few different portal fields, do i gotta have seperate field for each one? Right now I have seperate ones for each of them. I want to see if there is a better way. like 1 big case statement or something. Right now the code looks like this for each field where f and d are global number fields


[b]Arrow1[/b]

Case(

f = 1 and d = 1; cgArrowUp;

f = 1 and d = 2; cgArrowDown;

cgArrowUp

        )

     )



[b]Arrow2[/b]

Case(

f = 2 and d = 1; cgArrowUp;

f = 2 and d = 2; cgArrowDown;

cgArrowUp

        )

     )

[b]Arrow3[/b]

Case(

f = 3 and d = 1; cgArrowUp;

f = 3 and d = 2; cgArrowDown;

cgArrowUp;

        )

     )



[b]etc[/b]

Posted

Repeating calcs reference another field's repetition using the calc's repetition unless the Extend function is used. Given a repeating text field named Color with Color[1] = "Red", Color[2] = "Blue" and Color[3] = Green. A repeating calculation with If ( Color = "Red" ;... will have repetition 1's If test true and repetitions 2 and 3's false. Add another field, non-repeating, named myHue with the value "Red". If the calc is changed to If ( myHue = "Red" ;..., repetition 1 will be true, and all others false. If the calc is If ( Extend ( myHue ) = "Red" ;..., all repetitions will be true.

In the above calc, I assume that f and d are non-repeating fields and the calc is a repeating field. To work, it would have to have an Extend () around each f and d. Instead of manually specifying the = # for f, use Get ( CalculationRepetitionNumber ).

And a tip from the above code: Case(

f = 1 and d = 1; cgArrowUp;

f = 1 and d = 2; cgArrowDown;

cgArrowUp )

can be simplified to Case (

f = 1 and d = 2; cgArrowDown;

cgArrowUp )

That's a start, I guessed at a lot, so give us more info if this doesn't address the issue.

Posted

Thank you CyborgSam. That helps clarify things a somewhat.

Basically I have a few field containers right now that depending on the field number and the direction field, should either show the Asc or Desc arrow icon.

Case (

f = 1 and d = 2; cgArrowDown;

cgArrowUp )

So if I had 10 of these global cal fields (container), that need to show arrows I would need 10 seperate fields. I was trying to see if there was a better way of doing this through repeating calculations or something and consolidate these 10 into 1. But now I dont think this is possible so I will just use the multiple fields.

Posted

If you keep your sort orders in a repeating field; then the calc to display the graphics is simple:

ArrowUp (container, global)

ArrowDown (container, global)

SortOrder[10] (text field, repeating)

SortDisplay[10] (calculation, container result, repeating) = case(SortOrder = 1; extend(ArrowUp); extend(ArrowDown))

Each repetition is evaluated in the repeating calc.

This topic is 7027 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.