Jump to content
Server Maintenance This Week. ×

ExecuteSQL charting


This topic is 3899 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • 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)

Link to comment
Share on other sites

  • 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

Link to comment
Share on other sites

This topic is 3899 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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