简体   繁体   中英

Fabric Answers Rounding Int Values

As part of collecting my custom attributes for my Fabric Anwers events, I would like to obtain the birth year of my users.

This is set in app and ranges from 1920 to 2002. So, when an event is triggered, the users birth year is associated with the event as a custom attribute with type Int. For example:

Answers.logSearch(withQuery: searchText, customAttributes: ["BirthYear" : 1978])

On observing the event in the Fabric web app, I noticed that my custom attribute, "BirthYear" has been rounded to 2000 (2k in the Events dashboard). This is not granular enough for me for obvious reasons.

Is there any way to prevent this rounding from occuring, or would the best way to overcome this be by giving each birth year a value from 1 to 82, where 1 represents 1920 and 82 represents 2002. Would this still be rounded? Such that 82 would be rounded to 100? I want to be able to use this data to work out the average age of my users when certain events are triggered in my app.

I know this next part should be posted as a separate question, but can i delete the event(s) that have been rounded to 2000?

From personal experience, there isn't a way to disable the effect you're seeing. Also, I don't believe it is rounding but, from our analytics, it appears to be averaging the number sent in. If you want to retain the value, I suggest you send it in as a string.

Answers.logSearch(withQuery: searchText, customAttributes: ["BirthYear" : "1978"])

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM