Skip to main content
Hi there,

 

 

What I have is a dataset with a field named UPDATE. in this field, there are many differant values populated. Here's an example (imagine each line is an entry in the dataset table):

 

 

UPDATE

 

DESCRIP ; E_MAIL ; TEL_NR ; WEBSITE

 

E_MAIL ; WEBSITE

 

DESCRIP ; WEBSITE

 

E_MAIL ; TEL_NR ; WEBSITE

 

DESCRIP

 

DESCRIP ; TEL_NR

 

 

etc.. Please not that these multiple values (like DESCRUP ; E_MAIL) are contained in a single attribute.

 

 

So what I want as a result is to calculate how many times a set of specified values are present:

 

 

UPDATE                         COUNT

 

DESCRIP                      4

 

E_MAIL                          3

 

TEL_NR                        3

 

WEBSITE                      4

 

 

Currently my writer is an xls table, but I've had very little luck in achieving this output.

 

 

Any kind of help would be fantastic.
Hi,

 

One way to do that would be to:
  1. Split the UPDATE attribute > AttributeSplitter set on ;
  2. Clean list elements > StringReplacer text to find: ;|" ", replacement text " ",  use regular expressions: yes
  3. Explode list > ListExploder
  4. Aggregate > Aggregator group by _list , set a count attribute (_count)
There are probably other ways.
Staying fully in listtransformers u can

 

 

remove spaces->split on ";"->eplode list->build list grouped by  "_list" (assuming you didnt rename default)->listelementcounter on "_list"-> remove list.

 

Now u have atribute and its count.
Thanks guys, I just tried both methods, and they work beatifully!

Reply