07 May 2020 02:28 PM
Hi community,
i want to write this User Session Query:
SELECT useraction.name, COUNT(errorCount) from useraction WHERE name="name-of-useraction" GROUP BY useraction.name. It's work, but i must change the useraction's name (only in this query, i can't change the real name). I tried some like this query, withuot success:
SELECT useraction.name, COUNT(errorCount) from useraction WHERE name="name-of-useraction" AS "name-changed" GROUP BY useraction.name
The AS command doesn't work in this case, so how can i change my useraction's name in this query?
Thanks
Solved! Go to Solution.
07 May 2020 03:11 PM
The alias goes in the select part not the where clause:
select name as "New Name", count(errorCount) from useraction where name="name-of-useraction" group by name
07 May 2020 03:36 PM
Hi James, i can use this query: SELECT useraction.name AS "new name", COUNT(errorCount) from useraction WHERE name="old name" GROUP BY useraction.name and it's work, but doesn't change the useraction's name.
There is another way?
07 May 2020 03:52 PM
Oh I see the misunderstanding, you're not changing the name itself by doing an alias. You're changing the column name (i.e. what shows up in the column header in a table). I don't believe you can just rename the action like that outside of the funnel function.
Depending on what you're trying to do I'd just leave off the action name and use either an alias on the error count field or just the usql query name to specify what you'd like to refer to the action as:
08 May 2020 08:42 AM
I'm trying to execute this query in Bar Chart visualization (because i need to it):
When i upload query into the tile, i can't see full name, but only "Loading of page..." because it's cropped. So, i must use the alias command to write a shorter name.
Thanks for your help
09 May 2020 12:26 AM
Changing the Name of Columns is not supported at this time. I Spent some time looking for any way that we could adjust the name, even support looked into it and concluded that it was not possible at this time.
12 May 2020 01:48 PM
Thank you Chad for your answer
12 May 2020 01:51 PM
You're very welcome