DQL Query - how to get the appVersion

the appVersion is 3.0.1.1234 (a.b.c.d- format). but, i need to get the appVersion as a.b.c. how to achieve that in here? 
actually i achived that by using this code:

data record(appVersion = "3.0.2.1102")
| fieldsAdd versionParts = splitString(appVersion, ".")
| fieldsAdd truncatedVersion = concat(versionParts[0], ".", versionParts[1],".", versionParts[2])

but, i am unable to use this on my actual use case in userSessionQuery. 

Help me in this regard

One option would be to use the parse command to parse out the version, like this:

| parse appVersion, "(INT '.' INT '.' INT):truncated_version"

Could you show the query where your solution is NOT working?