Hello, I want to ask if data goods can do date red...
# gooddata-platform
g
Hello, I want to ask if data goods can do date reduction. Example:
Date (Delivery Date) - Date (Release Date)
Thanks
z
Hi, if there is a connection point between the dates, then yes you can do some arithmetic, please see:https://help.gooddata.com/doc/enterprise/en/dashboards-and-insights/maql-analytical-q[…]guage/maql-use-cases-and-tutorials/date-attribute-arithmetic
m
what if i want to search how many event that has duration over desired value?
z
@Michael Ardhyanto Hi Michael, can you share a bit more information about the case? I am not quite sure I can suggest a working solution unless I understand the case, model and object types you are working with. Right now it simply sounds like you want to count events with a WHERE condition. so something like SELECT COUNT (event_id) WHERE date_metric > 0 or am I wrong? the date metric is simply some arithmetic described in the article above.
m
@Zuzana Bednarova yes, the case i have field with date column and already created metric to calculate the date difference between release date and posted date. Now i wanted to count how many id where date difference were more than 3 days but when i tried on report i must brought out the id to see the calculation else it won't show
z
@Michael Ardhyanto I see, the metric looks ok - but only if you used a correct BY clause in your "TO Aging" metric / I can't tell because I don't know your model. But let's assume it is ok so now the question is what kind of report/insight it should be? KPI ? Table? What attributes will be in the columns or rows?
m
this is my TO aging metric without condition and what i expect on report should be KPI so it's only show number of how many id that had exceed 3 days
p
Just guessing because I don’t know your LDM but try
SELECT COUNT(To Number) WHERE (SELECT TO Aging BY To Number) > 3
m
in my LDM there's TO Aging table , i want to find out how many days different between posted date and release date. I have already made a metric to calculate the date difference using
SELECT *Date (Do Posted Date)* - *Date (Release Date)* BY *To Number*
. Now i want to count the TO number that had date difference more than 3 days using
select count(*To Number*) where (SELECT *TO Aging* BY *To Number*) > 3
. When i tried to put into analyze it didn't show any count
z
Hi this should work. I just tried to upload a single CSV and recreate the metrics and the result is what is expected I think.
here are the metrics: SELECT COUNT (Tonumber)
SELECT ( Date (Dateend) - Date (Datestart)) BY Tonumber
SELECT number WHERE *date*>3
m
@Zuzana Bednarova thank you for the solution it works for me but when i tried to make a single value metric by taking out the
Tonumber
and
date
it wont show any value
this is before and after i takeout the
date
to make a single value. It should be total
29
z
@Michael Ardhyanto Hi, can you please invite us to your project so we can review the measures and model? support+free@gooddata.com