Hi All, my customer table has a start date. If I ...
# gd-beginners
d
Hi All, my customer table has a start date. If I want to create a new custom column to say how long this customer has been with us in buckets, say 0 - 6 months, 1 year, 2 years, more than 2 years, Can I acheive this within the LDM or need to do this in my ETL?
j
Hello Dilaksha, We have a nice community article which describes how to work with time duration: https://community.gooddata.com/solution-architecture-62/working-with-time-in-workspace-201 Feel free to check that out and let us know about your thoughts.
👍 1
j
Hi Dilaksha, I assume you are using GD platform. You can create metric which calculates for example number of months since the start date which will work if you break it down by customer. For example:
Copy code
SELECT MIN(THIS- Month/Year(start date))
Then you can create computed attribute which will group customer using the above metric and you can define ranges like 0-6 months, 7-12 months,13-24 months and the rest and assign them descriptions 0-6 months, 1 year, 2 years, more than 2 years. See https://help.gooddata.com/doc/enterprise/en/workspace-and-user-administration/managin[…]a-and-data-access/manage-attributes/use-computed-attributes/ . You can do the same in ETL and add such attribute into your data model.
d
thanks @Jakub Sterba
p
🎉 New note created.