Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I want to create a new field called "AvgPlace" by calculating the average of the values for the places. My data is like this:
Place Store Value
A x 3
A y 2
B z 2
B v 4
B w 3
and I want a new table like this
Place AvgPlace
A 2.5
B 3
I want to do it on the Script, but it just keeo telling me "Invalid Expression"
Hi,
Try this
Data:
load * Inline [
Place , Store, Value
A , x , 3
A , y, 2
B , z , 2
B , v, 4
B, w, 3
];
NoConcatenate
Data2:
LOAD
Place //If you don't want the tables to join then rename this field
,Sum(Value) / Count(Place) AS AvgValue
Resident Data
Group BY
Place;
LOAD
Place,
avg( Value) as AvgPlace
RESIDENT YourTable
GROUP BY Place;
Hi,
Try this
Data:
load * Inline [
Place , Store, Value
A , x , 3
A , y, 2
B , z , 2
B , v, 4
B, w, 3
];
NoConcatenate
Data2:
LOAD
Place //If you don't want the tables to join then rename this field
,Sum(Value) / Count(Place) AS AvgValue
Resident Data
Group BY
Place;
You guys are amazing! Thank youu
Thank youuuu