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.

ExecuteSQL charting

Featured Replies

  • Newbies

I am trying to create a bar chart (eventually a stacked bar chart, but I wanted to make sure that I got the different data for the x-axis correct first) in FileMaker 12 Pro using ExecuteSQL. This one shouldn't be so hard since I have all the data in the same table, but I can't figure out what I'm doing wrong.

 

I have people working in four different groups ("Group"), and a column for active people ("Active"=1, "Inactive"=0) and a gender column (Male/Female). When I use the formula below, I get a nice bar chart showing how many men are working in each group. However, when I change the gender from "Male" to "Female", the amount of women is correct (3 women in one group, 2 in one, 2 in one and 0 in the fourth group), but the columns/bars are displayed on the wrong group (so that the group that has no female employees in the table has 3 female employees in the chart).

 

 

ExecuteSQL(
"
SELECT COUNT(*)
FROM "Table"
WHERE "Active" = ?
AND "Gender" = ?
GROUP BY "Group"
ORDER BY "Group"
"
;"";¶; 1; "Male" )

 

I have checked my data to make sure that it is correct, and as you can see I have used the foolproof "brackets" (I'm writing in another language so some of the words have special characters). What is happening? The million dollar question is perhaps whether it is a mere coincidence that it is working when I write "Male"?

 

For clarification, this is the "y" axis:

 

ExecuteSQL(
"
SELECT DISTINCT ("Group")
FROM "Table"
WHERE Active = ?
GROUP BY "Group"
"
;"" ;¶; 1)

  • Author
  • Newbies

ok I got it to work if I removed the "active" field. So how do I best go about to remove the inactive records from the chart?

  • 2 weeks later...

For the record delimiter, why are you including a paragraph symbol?

I don't know if this is the root of your problem, but it does look odd.

 

 

Seems like you can use the filemaker default;

 

ExecuteSQL(
"
SELECT COUNT(*)
FROM "Table"
WHERE "Active" = ?
AND "Gender" = ?
GROUP BY "Group"
ORDER BY "Group"
"
;"";""; 1; "Male" )  <<<--- change made here

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.