Skip to content

Conversation

@ReneSchroederLJ
Copy link
Member

@ReneSchroederLJ ReneSchroederLJ commented Oct 10, 2025

Description

  • implemented support for formulas in excel imports
  • updated test cases to test with formulas

resolves #1016

Pre-review checks

Please ensure to do as many of the following checks as possible, before asking for committer review:

  • DEPENDENCIES are up-to-date. Dash license tool. Committers can open IP issues for restricted libs.
  • Copyright and license header are present on all affected files
  • If helm chart has been changed, the chart version has been bumped to either next major, minor or patch level (compared to released chart).

Copy link
Contributor

@tom-rm-meyer-ISST tom-rm-meyer-ISST left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for handling!

For me the attached sheet (upload as supplier after ./deploy.sh -ci) fails.

It contains the following formula functions:

  • TEXT
  • VLOOKUP
  • NOW

It leads to an error and the following log message:

2025-10-13T08:16:02.976Z  WARN 1 --- [nio-8081-exec-5] o.apache.poi.ss.formula.FormulaParser    : FormulaParser.function: Name '_xlfn.UNIQUE' is completely unknown in the current workbook.

The interesting part likely is that there is data pulled from a second sheet in the same workbook. I've not used the Unique function. This may be implied by using

delivery-template-example.xlsx

VLOOKUP. Could you give it a check? Because that's exactly the use case we try to solve.

@ReneSchroederLJ
Copy link
Member Author

Thanks for handling!

For me the attached sheet (upload as supplier after ./deploy.sh -ci) fails.

It contains the following formula functions:

  • TEXT
  • VLOOKUP
  • NOW

It leads to an error and the following log message:

2025-10-13T08:16:02.976Z  WARN 1 --- [nio-8081-exec-5] o.apache.poi.ss.formula.FormulaParser    : FormulaParser.function: Name '_xlfn.UNIQUE' is completely unknown in the current workbook.

The interesting part likely is that there is data pulled from a second sheet in the same workbook. I've not used the Unique function. This may be implied by using

delivery-template-example.xlsx

VLOOKUP. Could you give it a check? Because that's exactly the use case we try to solve.

Thank you for the example.

I've taken a quick look and, as the error message suggests, the issue is actually none of the Formula functions you've listed, but UNIQUE, which is used when transposing the column names to rows for the Help spreadsheet. UNIQUE is not supported by Apache POI. In this case the use of UNIQUE is not necessary since all column names are already unique so removing it would fix this particular issue.

Fixing it reveals some other issues in the sheet though. The data incorrectly lists the supplier's BPNL as partnerBpnl. As of writing it also has lastUpdatedOnDateTime set to be at 23:59:59 today, which is invalid as the date needs to be in the past.

With the updated documentation according to your other comment, I would suggest omitting the use of UNIQUE as it is not essential to the usability of the file.

@tom-rm-meyer-ISST
Copy link
Contributor

Thanks for handling!
For me the attached sheet (upload as supplier after ./deploy.sh -ci) fails.
It contains the following formula functions:

  • TEXT
  • VLOOKUP
  • NOW

It leads to an error and the following log message:

2025-10-13T08:16:02.976Z  WARN 1 --- [nio-8081-exec-5] o.apache.poi.ss.formula.FormulaParser    : FormulaParser.function: Name '_xlfn.UNIQUE' is completely unknown in the current workbook.

The interesting part likely is that there is data pulled from a second sheet in the same workbook. I've not used the Unique function. This may be implied by using
delivery-template-example.xlsx
VLOOKUP. Could you give it a check? Because that's exactly the use case we try to solve.

Thank you for the example.

I've taken a quick look and, as the error message suggests, the issue is actually none of the Formula functions you've listed, but UNIQUE, which is used when transposing the column names to rows for the Help spreadsheet. UNIQUE is not supported by Apache POI. In this case the use of UNIQUE is not necessary since all column names are already unique so removing it would fix this particular issue.

You're right I missed that table (and search for Unique had no hit)!

Fixing it reveals some other issues in the sheet though. The data incorrectly lists the supplier's BPNL as partnerBpnl. As of writing it also has lastUpdatedOnDateTime set to be at 23:59:59 today, which is invalid as the date needs to be in the past.

I did the fixes. Interestingly with the formulas evaluated in a line the quantity is not passed as numeric anymore. I attached version 2 of the file. get the error in the upload "Cannot get a NUMERIC value from a STRING cell Further validations for this row are not possible."
After also doing a VLookup in Row 3, the row has the same error.

delivery-template-example2.xlsx

With the updated documentation according to your other comment, I would suggest omitting the use of UNIQUE as it is not essential to the usability of the file.

I'm with you here!

Copy link
Contributor

@tom-rm-meyer-ISST tom-rm-meyer-ISST left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot. One more question, because I found something confusing. I think we can't easily change it programatically, but it might be worth a further note in the user guide. I would love to get your thought on it; I'm also fine with the current solution.

I expanded the example to lookup the quantity value (realistic scenario):

delivery-template-example3.xlsx

The lookup works from data:C2 to Support Table:K2.

  • If I format data:C2 as Number, then it works
  • If I format Support Table:K2 as Number, too, then it doesn't work (attached this as v3)

The error is OK from my point of view:

Image

We might need to add something to the user guide like: "When using formulas, please ensure that the final cell is correctly formatted (e.g. quantities as number). If you lookup values (e.g. VLOOKUP), the cell to perform a lookup on must be formatted as general."

@ReneSchroederLJ
Copy link
Member Author

Thanks a lot. One more question, because I found something confusing. I think we can't easily change it programatically, but it might be worth a further note in the user guide. I would love to get your thought on it; I'm also fine with the current solution.

I've addressed the issue. Lookups should now work with the correct cell types.

Copy link
Contributor

@tom-rm-meyer-ISST tom-rm-meyer-ISST left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot! Small change in code but tedieous to test and big impact!

@tom-rm-meyer-ISST
Copy link
Contributor

@ReneSchroederLJ I can't resolve the conflicts. Could you please update the branch / merge main?

@ReneSchroederLJ ReneSchroederLJ force-pushed the feat/excel-formula-support branch from e991929 to 47419f8 Compare October 15, 2025 13:45
@tom-rm-meyer-ISST tom-rm-meyer-ISST merged commit 4d10989 into eclipse-tractusx:main Oct 15, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug][Story] Excel Import Should Evaluate Formulas

2 participants