Try this in the script. That's the best place to calculate these things.
load start_area, destination_area, transport, sum(amount) as sum_amount
from ...mysource... group by start_area, destination_area, transport;
concat(destination_area&':'&sum_amount&','transport_type,'|') as output4webservice
from Temp group by start_area;
Thanks for your answer Gysbert. However my requirement is to avoid pre-calculations in the load script, in order to be able to update the map by doing selection in the qlikview document, while your solution always give the same result without relation to the current selection state.
Is there a way to dynamically generate the properly formatted input to feed my webservice?
I can achieve what I want with an extension which has start_area, destination_area and transport_type as dimensions, and manually aggregate the data rows in the extension code to create the formatted output, but I also need to get another expression to be evaluated for every start_area so I cannot use a multi-dimensional object.
I've just discovered that it is possible to give more than one dimension to the aggr function!
So if my object has start_area as its dimension, the expression to get the formatted output is simply:
aggr(destination_area & ':' & sum(amount) & ',' & transport_type,
start_area, destination_area, transport_type)
I was trying to nest aggr with a different field in every nesting.... This is much simple and give the results I want.