Merge and center after pivoting

Hi, I did pivoting in Knime and I would like to improve the formatting of the report : I need to merge cells with the same content and the structure of the report will change every run.
I have attached an example : “data” sheet is what I have, “formatted” sheet is what I need to achieve.
example.xlsx (16.1 KB)

Hi @Skirpichnikova_Ksenia -

If your final report is in Excel format, then you could use the Continental Nodes for KNIME, and specifically the XLS Cell Merger node, to adjust the format of your spreadsheet after the data table is written out.

If you are generating your report in some other format I suppose we need to know what that format is. :slight_smile:

1 Like

hi, @ScottF, thanks for answering. As I wrote before the structure of the report will change each time and I don’t know what rule can be created to merge cells related to one and the same account. Can you help with this?

Here I think you will want to take advantage of the unpivoting option in the XLS Control Table Generator when defining your control table. You could then use the Rule Engine to apply a merge label to the fields to be merged, and then “re”-pivot afterward. This may be a little tricky at first, but should be doable.

Take a look at option 3 in this example workflow, which demonstrates the idea of unpivoting, applying rules, and “re”-pivoting:

1 Like

@ScottF, I think you did not opened the example file I have attached :slight_smile:
I know how to use XLS Control Table Generator, my question is: pivoting in excel gives a pivot table where rows related to one account are merged and centered. Knime by default does not have this feature and I would like to achieve it by formatting : in the attached “example” file sheet “data” is what I have by now and sheet “formatted” is what I need.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.