Hi,
I have extracted the list in JSON file to an excel file using ListExploder. However the result didn't come out as expected:
Any suggestions on which transformer can I use to get the expected result as attached:
Thank you in advance.
Hi,
I have extracted the list in JSON file to an excel file using ListExploder. However the result didn't come out as expected:
Any suggestions on which transformer can I use to get the expected result as attached:
Thank you in advance.
Use ListElementCounter to get the total number of elements, ListExploder to separate into features.
Use AttributeManager to create 4 new attributes (your list appears to have 4 columns) with conditional values: if
@fmod(@Value(_element_index),4)=0
than give the first attribute the value of station_info_apims, =1 the second, =2 the third and =3 the fourth.
Than create a fifth attribute that will become the new index with the value:
(@Value(list_count)-@Value(_element_index))/4+@fmod(@Value(_element_index),4)/4
And just use an Aggregator with GroupBy your fifth attribute Mode set to Attributes Only and Accumulation Mode set to Merge Incoming Attributes.
I attached a sample workspace.
Use ListElementCounter to get the total number of elements, ListExploder to separate into features.
Use AttributeManager to create 4 new attributes (your list appears to have 4 columns) with conditional values: if
@fmod(@Value(_element_index),4)=0
than give the first attribute the value of station_info_apims, =1 the second, =2 the third and =3 the fourth.
Than create a fifth attribute that will become the new index with the value:
(@Value(list_count)-@Value(_element_index))/4+@fmod(@Value(_element_index),4)/4
And just use an Aggregator with GroupBy your fifth attribute Mode set to Attributes Only and Accumulation Mode set to Merge Incoming Attributes.
I attached a sample workspace.
Thank you so much for your answer! I'm new to this FME and your answer really helps me. I will try your solution to resolve this issue.
Thanks again!