-
1. Re: Age calculation
maneesh.gaddam Feb 11, 2019 8:53 AM (in response to lu.gan.2)Hi,
You can write it as
DATEDIFF('year', [Year of Birth], YEAR(Today()))
-
-
3. Re: Age calculation
maneesh.gaddam Feb 11, 2019 9:18 AM (in response to lu.gan.2)1 of 1 people found this helpfulMy apologies, I got confused
You can rewrite it as
DATEDIFF('year', [Birth Date],Today()) -- this gives you years
Also otherway to write it is YEAR(Today())-YEAR([Birth Date])
If you want to also calculate months, replace 'year' with 'month' in datediff calculation.
-
-
5. Re: Age calculation
maneesh.gaddam Feb 11, 2019 9:34 AM (in response to lu.gan.2)1 of 1 people found this helpfulIt is probably summing up the age. Right click on your age field and select convert to dimension. Tableau moves the field to the dimensions pane and from there drag the field to the rows. It should fix it.
-
6. Re: Age calculation
lu.gan.2 Feb 11, 2019 9:36 AM (in response to maneesh.gaddam)Got it!!!
Thanks a lot!
-
-
8. Re: Age calculation
maneesh.gaddam Feb 11, 2019 11:41 AM (in response to lu.gan.2)Is that year filter a parameter?
If so, you can write your calculated field as
[YEAR Parameter]-YEAR([Birth Date])
-
-
10. Re: Age calculation
maneesh.gaddam Feb 11, 2019 12:04 PM (in response to lu.gan.2)1 of 1 people found this helpfulThen it would be
INT([Year]) - YEAR([Birth Date])
-
11. Re: Age calculation
lu.gan.2 Feb 11, 2019 12:12 PM (in response to maneesh.gaddam)Life saver!!!
Any suggestion on learning Tableau? (Cannot find a good tutorial online~~~)
-
12. Re: Age calculation
maneesh.gaddam Feb 11, 2019 12:23 PM (in response to lu.gan.2)Look no other than free Tableau learning videos Learning | Tableau Software. I found them very helpful.
-
13. Re: Age calculation
lu.gan.2 Feb 11, 2019 12:38 PM (in response to maneesh.gaddam)Got you~!! Many thanks~!