Question

aggregate values in key-value pairs and write matrix


Badge +6
  • Contributor
  • 53 replies

This is my initial data:

Name,Value

 

sza034,ber_afu

 

sza033,ber_awn

 

sza034,ber_afl

 

sza033,ber_afu

 

sza034,ber_afu

 

sza032,ber_awn

 

sza034,ber_afl

 

sza033,ber_fff

 

sza033,ber_bgt

 

sza033,ber_afu

 

sza033,ber_jij

The result has to be a matrix, with a row for each unique name and a column for each unique value.

the fields in the matrix have to be filled with "yes" or "no":

Name,gschber_afl,gschber_afu,gschber_awn,gschber_fff,gschber_bgt,gschber_jij

 

sza034,yes,yes,no,no,no,no

 

sza033,no,yes,yes,yes,yes,yes

 

sza032,no,no,yes,no,no,no

By using the Aggregator, AttributeSplitter, ListDuplicateRemover and ListSorter, I managed to get for each name a list with its unique values. But how can I write this matrix now?

Thanks in advance.

Vera


5 replies

Userlevel 2
Badge +17

Hi @vki, this workflow might help you.

Badge +22

If your potential values are static (don't change) then use takashi's workflow. If they are dynamic, or there are too many to manually expose, here's an alternative.

 

keyvalueyesno.fmwt
Badge +6

Thanks for your answers. takashi's one was perfect for me.

Badge +6

If your potential values are static (don't change) then use takashi's workflow. If they are dynamic, or there are too many to manually expose, here's an alternative.

 

keyvalueyesno.fmwt

@jdh​ 

I have to come back to this post, for now I need a solution for dynamic values...

Unfortunately, I can't download keyvalueyesno.fmwt anymore.

Could you explain me, how you managed to create a dynamic matrix?

Thanks, Vera

Badge +22

@jdh​ 

I have to come back to this post, for now I need a solution for dynamic values...

Unfortunately, I can't download keyvalueyesno.fmwt anymore.

Could you explain me, how you managed to create a dynamic matrix?

Thanks, Vera

It turns out I still had the workspace. The MergedSchemaSetter has since been replaced with the SchemaSetter on the hub.

Reply