hi, I couldn't find the distinct count option for...
# gd-beginners
g
hi, I couldn't find the distinct count option for two categories in a crosstab. ā€¢ Country CountDistinct Users ā€¢ Select Count( distinct Users) ā—¦ seems not to exist thanks ?
m
Hi Gorden, The MAQL Count function is a powerful function that helps you count the numbers of distinct values of an attribute while slicing by other related attributes. Regarding the SELECT DISTINCT statement, our COUNT function is exactly that, a count of distinct values. You can find an in depth article here, and you can also check our documentation for reference. I hope this helps.
g
thanks I see, Count() is already a distinct
m
Correct šŸ™‚
g
thanks
another question: if I want the min and max timestamps for each country for example would that be SELECT COUNTRY, MIN(my_timestamp) AS min_TS my_timespamp is not selectable ?
m
Your metric would need to follow the syntax as shown here in our documentation: https://help.gooddata.com/pages/viewpage.action?pageId=86788071
I can also recommend our free MAQL course in case you would like to know more about it: https://university.gooddata.com/getting-started-with-maql
g
within the min function it desnt let me choose my_datetime which is YY-MM-DD HHMMSS
m
This is because the function returns the minimum value of all numbers in the set, but the timestamp was uplaoded as an attribute, however, the following community post covers how to work with timestamps and includes an example with MIN: https://community.gooddata.com/solution-architecture-62/working-with-time-in-workspace-201
g
thanks
šŸ‘ 1
I have mapped my_datetime as timestamp, so SELECT MIN(my_datetime (Int) doesnt work, my_datetime can't be excessed in the SELECT in the Data tab I tried to add+map my_datetime again to my_datetime_str, but it wouldnt allow me to do so, converting the DB format, should be possible, right ? my date colums have a key symbol although they're not any kind of PK or FK thanks for help šŸ™‚
@Moises Morales hi there I ve observations with datetime. I want to compute the min and max datetime for a selected field like country for example. Could you help me on this ? as a metric with SELECT min(my_datetime) does not work ?