October 31, 20196 yr   I have a database that was imported from an Excel spreadsheet.  It has rows of repetitive data in it.  I simply need to do some query searches in it to pull the data out.  Users where asked questions, and obviously there are answers. Each question has a unique label on it 😀, and each user has a unique ID Number😀! So my question(s) is, how do I get both fields, QUESTION_ID  and  RN_NUMBER to both come up to show me the question and answer?  Do I create a script that has in "IF" statement and then another "IF" statement inside of that ?? Â
October 31, 20196 yr Author Can you use & when doing and IF statement?   If WorkForceData::Gender = "Male" & WorkforceData::Question_ID = "Q-000631"
October 31, 20196 yr 3 minutes ago, 1FilemakerMan said: Can you use & when doing and IF statement? You want the ANDÂ logical operator - not the & text operator. https://fmhelp.filemaker.com/help/18/fmp/en/index.html#page/FMP_Help%2Flogical-operators.html%23ww1029464 https://fmhelp.filemaker.com/help/18/fmp/en/index.html#page/FMP_Help%2Ftext-operators.html%23ww1029503
October 31, 20196 yr Author If [WorkForceData::Gender = "Male" and WorkForceData::Quesiton_ID = "Q-000631"] $Male + 1  ^^ Could that work, $Male of course being a variable. I am going to give this a try 🙂
October 31, 20196 yr I don't know. You started this thread by asking about doing a find for a report. At least I think you did - I did not understand the question that well. Now you're showing something that could be part of a script or a calculation (but isn't either), with no context and no explanation what it's supposed to do, and you ask if it could work. I don't know. Â
October 31, 20196 yr Author It is supposed to go through that WordForceData table and count how many times when the field Gender = Male and the field Question_ID =q-000631 WorkForceData::Gender = "Male" and WorkForceData::Quesiton_ID = "Q-000631"  I just ran it and It looks like it is locked up, won't stop running.
October 31, 20196 yr Re the script you added: it might work if instead of going to the last record, you go to the next record, with the option 'Exit after last' turned 'On'. And I think you want to start with the counters at 0, not 1. There's probably a better way to do this, but ...Â
October 31, 20196 yr Author ?? Thanks for your help first of all!!! But could you please be more precise? Remember, I am a rookie,  🙂 . I don't see where it says to go to the last record, and where I would put "Exit after Last" turned on  . SORRY, could you give example, or tell me where to put that?? I am google searching now.. Â
October 31, 20196 yr You can read about it in the help: https://fmhelp.filemaker.com/help/18/fmp/en/index.html#page/FMP_Help%2Fgo-to-record-request-page.html%23 Edited October 31, 20196 yr by comment
October 31, 20196 yr Author Ok, I did that, and thanks for clarifying it by the way!!, and nothing is popping up. I was hoping to click the button, run the script, and it would count the numbers for me of how many males and females we have. the $males and $Females total.  Could I make $males and $females global and just show their numbers?? 😉 Â
October 31, 20196 yr Well, you need to do something with the variables after the loop has finished running. Like set a field with them, or show them in a custom dialog. Once the script has run out, they are erased from the board.
October 31, 20196 yr Author So I did some googling and found the "Set Field" command.  I am trying to push the numbers from the global variables over to the set field areas.  Not quite working yet.  I put them at the bottom of the script.   When I click on my shortcut block to execute the script I get a strange square like icon that pops up, and nothing happens. I have a Macintosh machine, I don't know if that is supposed to be like an hourglass or what, but I seem to get nothing. 😡  I tried to capture how it looks, but I obviously can't. I feel like I am so close to getting the ******* count of how many Male and Females there is. After that, boom it opens up the door for me to understand how to do all of these ******* queries!
October 31, 20196 yr Computers are unforgiving: $male is not the same thing as $$male. Read: https://fmhelp.filemaker.com/help/18/fmp/en/index.html#page/FMP_Help/using-variables.html#ww1030458
Create an account or sign in to comment