Mapping text to values


I’m trying to make a graph of users activity.
I have a table made by polling periodically and looks like this:

time                               user
2018-08-06 12:12:39                admin
2018-08-06 12:12:39                nick
2018-08-06 12:13:39                unknown
2018-08-06 12:14:39                unknown
2018-08-06 12:15:39                nick
2018-08-06 12:15:39                paul
2018-08-06 12:16:39                nick
2018-08-06 12:17:39                nick

I succeed to draw the global activity by using IF(user="unknown", 0,1) as user but is it possible to actually show the value of the user (admin/nick/paul)?


Where are you inserting this logic to map a text value to a number?

IF(user=“unknown”, 0,1)