Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

count expression with text

Hello,

I have a question about the count expression. For example, we have table of driver's (fields ID_driver, name_car, city....), then i have a car's table (fields, id_car, name_car, driver_id, car_type). I would like to make a stack graph with the number of drivers that use a type of car. I mean, in the y axe we will have count(id_driver) and in the x axe (city). The question is how can i do the y axe? if i use count(id_driver) it doesnt work, id_driver is a text, i need to counter the numbers of drivers that we have in each city. If i have not been clear, please let me know.

Thanks

1 Reply
Not applicable
Author

Hi Raul,

What is the result you get with that expression? Too many values than the expected?

Try usind count( DISTINCT id_driver ).

I assume there are numeric and repeated values because it is a key, so you have to use the DISTINCT clause.

If that doesn't help please explain better the tables involved.

Regards.