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.

Position vs. Patterncount Smackdown

Featured Replies

So, I have this really really big concatenated list of composer + songs here, sorted by composer. Some composers are tremendously prolific (a few of them have several thousand songs) and some are one-hit-wonders. I want to return the value number of the first and last songs of a certain composer, and I want them the fastest way possible in a calc. I can also see all the composers songs through a relationship, but there are duplicates in this set (lets say due to them being on multiple albums or something), none in the list.

I can deal with workarounds, but they must be faster than dealing with the list which I already have on hand. I can not use a valuelist for this, as each song is stored in the same row of a repeater in different records (sorry, but the repeaters have to stay as well). The other rows have unrelated data that I do not want to consider.

Do I:

1). Position the first one and right position the last one.

2). Position the first one and patterncount the last one.

3). Position the first one and count the sum of a unique selfjoin through the relationship.

4). Do something else (what?)

Any thoughts?

-Raz

Hi

can we assume that the first five letters of each row of the list are always different for different composer ? ( or better a minor number too)

How much rows will ever contain that list (about) ? 10,000 100,000 500,000 ?

  • Author

I am planning on reserving the first 20 spaces or so for the composer names in a

replace("000000000...."; 20-length(Composer); Composer; length(Composer))

kind of deal to secure the sort (there are other measures in place to keep composer length 20 or under). A Position on this 20 header will get the first one.

This will be for drop down menus, so while I usually do not like to use more than 20 or so values, certain ones would want to use FM native typeahead for searching large indexes. I would like it to have no limit beyond the size of a text field. In practice, I could settle for 32000.

*I should note that I am ultimately planning to use a repeating stored text calc to get the values. I want to shut off the recursion exactly at the last needed value, so need the last value number in the list to match with the CalcRepNumber + Start Value.

Edited by Guest

  • Author

Nevermind, I figured it out: the answer is 'yes'.

You do all three (or four), whichever is faster for the current query.

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.