Trying to create a graph where it shows employees < 60 months =>60 and < 120 etc. Have done datediff("m",startdate,date()) but can't get the count function to work to add, tried sperate query and still can't get it to work to work with the graph.
Kevin Yip
@Reply 3 years ago
Your query needs a column that will show only 3 values to represent your 3 categories. It could be text, or any data that would indicate <60m, between 60 and 120, or >=120, etc. But the column has to have only these 3 values in order for the Count() function to work, because Count() only works for groups of data that have the same values. And the expression you use does not give you the 3 distinct values. Datediff("m",startdate,date()) would give you 31, 6, 100, 24, 45, 42, 29, 199, etc. -- it would give you all the different ages of your employees, which are all different, and that is why it isn't working.
In other words, the query for your graph should return something like this:
EmployeeID InCompany
1000 "Less than 60 months"
1001 "Less than 60 months"
1002 "Between 60-120 months"
1003 "Less than 60 months"
1004 "Less than 60 months"
1005 "Less than 60 months"
1006 "Over 120 months"
1007 "Over 120 months"
1008 "Between 60-120 months"
1009 "Less than 60 months"
Etc.
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Visitor Forum.