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

calculation

Featured Replies

  • Newbies

Please could someone help? I have spent a couple of hours trying to figure this out but to no avail... ???

I have a collected data using a questionnaire, and would like to enter it onto a database.

Each question has four options, with each scoring a number of points, e.g.:

Q1 (How happy are you?)

A: (choosing one of the following four options)

i am always happy = 1

i am usually happy = 2

i am usually unhapppy = 3

i have lost the will to live = 4

I have formatted the field, so that the four options appear as "radio buttons".

My question, please:

How do I create an automated field, so that if the first option is chosen ("i am always happy"), the number "1" automatically appears, in another field which I shall call "scoreQ1"; if the second option is chosen ("i am usually happy"), the number "2" automaticlaly appears, and so on and so forth.

I have done this (via Define-> Database -> Specificy Calculation): In the Specify Calculation dialog, I have used "If" function, e.g.

scoreQ1 = If (Q1 = "i am always happy"; 1; 0) + If (Q1 = "i am usually happy"; 2; 0) + If (Q1 = "I am usually unhappy"; 3; 0) + If (Q1 = "i have lost the will to live"; 4; 0)

I have also tried "and" instead of "+", and "or" instead of "+". I have also triple (!) checked that the spelling/spaces/wording within the " " are correct. I have also double checked that I have chosen 'Calculation' for Field Type, and 'Number' for Calculation Result. However, nothing seems to work!

Have I misunderstood some fundamental principle of Filemaker? I've read the tutorial and User's Guide a few times now, and used the Help function, but can't get it. I use Filemaker Pro 7.

Thanks in advance.

Sui

Case( 

Q1 = "i am always happy"; 1 ;

Q1 = "i am usually happy"; 2 ; 

Q1 = "I am usually unhappy"; 3 ;

Q1 = "i have lost the will to live"; 4 ;

"" 

)

This answers your question, but it may not solve your problem.

Please do yourself a favour and get off FMP 7. FMP 8.5 is now available very cheaply because it cannot be upgraded any more. FMP 8.5 is a much better version than FMP 7. FMP 9 is better again.

Have I misunderstood some fundamental principle of Filemaker?

IMHO, yes - but not at the point you ask about. These options should be in a table of their own, with a field for Score. This way when one selects an option, the score is retrieved (or looked up) from the related record in the Options table - and no calculation is necessary.

  • Author
  • Newbies

Thanks both, for reply. This is my first opportunity to go online since posting my query.

I shall try the table suggestion now.

Cheers.

Sui

Edited by Guest

  • Author
  • Newbies

Thanks Vaughan. Just tried the the Case function, didn't work unfortunately.

Cheers.

Sui

Edited by Guest

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.