Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I want to calculate the avg age in years [gauge chart]
my date field = opendate format [DD-MM-YYYY]
how to calculate this?
Maybe just
= Avg( Age( Today(), opendate))
thanks but I need to calculate the today-Mydate [ as avg days]
avgdays is not required ?
Hi ,
Use below code
Date(Today(),'DD-MM-YYYY') - Date(Opendate,'DD-MM-YYYY') . Using this you will get the no'of days.
If you want to calculate in Years , Using the the IF condition you can able to retrive the year bucket.
Like IF(Date(Today(),'DD-MM-YYYY') - Date(Opendate,'DD-MM-YYYY')) <= 365 ,'< 1 Year',
IF(Date(Today(),'DD-MM-YYYY') - Date(Opendate,'DD-MM-YYYY')) > 365 and
IF(Date(Today(),'DD-MM-YYYY') - Date(Opendate,'DD-MM-YYYY')) <= 730 , '1 to 2 Years' )
Thanks,
Venkata Sreekanth
thanks its fine.
but I don't want to create if condition
I want to use as measure directly
can I use like below?
Now I got the no of days
so = avg(Numfday)/365 ?
Hi sony, you can calculate the age in script with Age() function, and use an Avg() of this new field to calculate the average.
In front-end can be done with aggr()
Avg(Aggr(Age(Today(), opendate), FieldToIterateRecords) //IdEmployee/IdPatient...
please post some sample values and your expected result.