.net datasets expressions columns

Soldato
Joined
13 Dec 2002
Posts
7,646
Location
Manchester City Centre
Hopefully this is just a quick q, basically just want to know if i can do what i want, and roughly how to do it

I have a table stored as an xml file and worked on using a dataset

for the sake of simplicity it has three columns: user_id, week_start, profit
I want to work out the average profit per user, and potentially per range of week_start for each user
the most sensible way i can see to do this if possible is to use an expression column, but can you use them in that way

any help/suggestions much appreciated
 
no ideas on this? :(
i can obv do it by pulling the data out then averaging it, but the less data i have to pull into the application the better
 
i've found that Compute() does exactly what i want

if anyone's interested the syntax is:

table.Compute("Avg(Total)", "UserID = x")
where obviously avg is the calculation i want to perform and userID = is the filter to say which ones i want it performed on
just randomly found it on an unrelated site by chance
 
Back
Top Bottom