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.
Juggernaut

Featured Replies

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]

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.

  • Author

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.

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.

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.