OK - it's done. That copy attributes command worked like a charm with
the loop attribute fed into it.

There is an example on fmepedia at...
http://www.fmepedia.com/index.php/Sandbox

...look to the foot of the page for the workspace and data
(zoning.zip). Basically it counts how many there are of each type of zone.

I'll move it to a more appropriate page when time permits.

Another reason for a group-by in the StatisticsCalculator. I'm really
going to push for that one for 2008.

Hope this is useful

Mark

--- In [email protected], "Jeff Konnen" <[EMAIL PROTECTED]> wrote:
>
> Hey Mark,
> 
> when I read Steve's post I was about to write about the
FMEFunctionCaller
> when I saw that you already did so with particular greetings to me :)
> 
> That's cool ...
> 
> You can even go further:
> 
> For the moment the problem is that you do not know how many times
you should
> call
@CopyAttributes(@Value(histogramList{0}.value),histogramList{0}.count)
> as you do not know how many values you have.
> 
> I would do this:
> 
> create a custom transformer
> 
> in this one, I would integrate a ListElementcounter (=> _nCount) and
thanks
> to the superb looping functionnality in the custom transformer, I
would add
> a loop port looping exactly nCount (with a tester (_i < _nCount) and and
> Expressionevaluator=> _i = _i + 1) times to call @CopyAttributes(@Value(
> [EMAIL PROTECTED](_i)}.value),[EMAIL PROTECTED](_i)}.count)
> 
> (okok, I saw further down in your email, that you were already
suggesting
> this, but now it's written down :))
> 
> And for the "Exposer": Seems a bit more difficult to make it dynamic
as the
> schema will be data driven.
> The important is that the attributes are there, even if you cannot
see them
> in Workbench.
> 
> Greetings,
> Jeff
> 
> On 5/31/07, mark2atsafe <[EMAIL PROTECTED]> wrote:
> >
> >   Hi Steve,
> > Assuming I read it right, there's a couple of options.
> >
> > 1) Do it manually. Expose _DEP_histogram{0}.count and then in an
> > AttributeCreator create an attribute called OnTime using the exposed
> > attribute to set the value.
> >
> > 2) Automatically. Use Jeff Konnen's excellent idea for the
> > FMEFunctionCaller - I just tried this with a workspace using the
syntax...
> >
> > @CopyAttributes(@Value(histogramList{0}.value),histogramList{0}.count)
> >
> > ...and it worked fine.
> > The only problem is that the attribute isn't 'exposed' within
> > Workbench. You'd have to expose it manually.
> >
> > I will post my workspace to fmepedia shortly as an example of how to
> > use FMEFunctionCaller (and ListHistogrammer). In fact I might even
> > roll it into a custom transformer, because then you could loop through
> > the list creating an attribute for each entry.
> >
> > With development for FME2008 due to start I'm sure we (the support
> > team) will be asked what our hot issues are for this year. I think I
> > will suggest a transformer to create an attribute, taking the
> > attribute name from an existing attribute value. It seems to be a
> > popular need.
> >
> > If you have FME suggestions then don't forget the add them the list on
> > fmepedia... http://www.fmepedia.com/index.php/FME_Suggestions (we do
> > look at this, promise).
> >
> > Regards,
> >
> > Mark
> >
> > Mark Ireland, Senior Product Specialist
> > Safe Software Inc. Surrey, BC, CANADA
> > [EMAIL PROTECTED] <support%40safe.com> http://www.safe.com
> > Solutions for Spatial Data Translation, Distribution and Access
> >
> >
> > --- In [email protected] <fme%40yahoogroups.com>, "snelsons2006" <
> > steve.nelson@> wrote:
> > >
> > > Hi group,
> > > Can anyone think of a way to use the results from the
> > > ListHistogrammer as new attributes? I've tried exposing attributes
> > > but can't find a way to create new attribute/headings with the
> > > Histogrammer results...
> > >
> > > I'm reading a spreadsheet, and creating a list based on a column,
> > > then I'm using the ListHistogrammer to see how many 'counts' of each
> > > value I have.
> > >
> > > A sample of my results:
> > > _DEP_histogram{0}.count: 78
> > > _DEP_histogram{0}.value : OnTime
> > > _DEP_histogram{1}.count: 9
> > > _DEP_histogram{1}.value : LeaveEarly
> > > _DEP_histogram{2}.count: 7
> > > _DEP_histogram{2}.value : LeaveVeryLate
> > > _DEP_histogram{3}.count: 3
> > > _DEP_histogram{3}.value : LeaveLate
> > > _DEP_histogram{4}.count: 1
> > > _DEP_histogram{4}.value : LeaveVeryEarly
> > >
> > > Is there a way to be able to then have 5 new attributes with the
> > > corresponding list "value", and the "count" as the new attribute's
> > > value - like this:
> > >
> > > OnTime 78
> > > LeaveEarly 9
> > > LeaveVeryLate 7
> > > Leave Late 3
> > > LeaveVeryEarly 1
> > >
> >
> >  
> >
> 
> 
> 
> -- 
> Jeff Konnen
> INSER SA
> Switzerland
> +41 (0) 21 643 77 11
>




For insights into what's up at Safe Software and what's on the development 
horizon, visit Safe's blog at spatial-etl.blogspot.com.

Love FME? Then open your diary to March 6-7, 2008 and write this... "Second 
Worldwide FME User Conference - Must Attend!" See 
http://www.safe.com/company/fmeuc2008/index.php for more details. 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/fme/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/fme/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to