load those values you need distinct in table one.
load those datas you need multiple in a second table.
Links both tables by those fields you Need (is sessionid enough?)..
the other is:
load your datas order by (sessionid)
if(previous(sessionid=sessionid,1,0) as FlagMultiple
sum or Count those values you need distinct with FlagMultiple = 1 only
you could do something like this:
SessionID as T_SessionID,
TextValue as T_TextValue,
NumericValue as T_NumericValue;
SQL SELECT ... ;
T_SessionID as SessionID,
T_TextValue as TextValue,
sum(T_NumericValue) as SumNumValues
Group by T_SessionID, T_TextValue;
Drop table TempTable;
Alternatively, if your data is in SQL database, you could do grouping right in the SQL query.