Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@ being inserted in formulas using structure references #57

Open
beniutek opened this issue Apr 21, 2020 · 0 comments
Open

@ being inserted in formulas using structure references #57

beniutek opened this issue Apr 21, 2020 · 0 comments

Comments

@beniutek
Copy link

so I have a function, that simple inserts a formula into a cell in the sheet.
    def write_formula_row(sheet, start_row, start_column, type)
      formula = "=SUM(SUBTOTAL(3,OFFSET(Database!$E$1,IF(table1[#{type}]=\"#{type}\",ROW(db_table[Break])-1,0),0)))"

      sheet.write_formula(start_row, start_column, formula, body1)
    end

In other worksheet I have a table and type string is the same as the column name of that table
Now, when I create an excel file and go to my worksheet I see that there are errors in this formula and upon investigation i see that instead of (let's say type is "Foo") formula being like below:

=SUM(SUBTOTAL(3,OFFSET(Database!$E$1,IF(table1[Foo]=\"Foo",ROW(db_table[Break])-1,0),0)))

the formula in excel looks like below:

=SUM(SUBTOTAL(3,OFFSET(Database!$E$1,IF(table1[@Foo]=\"Foo",ROW(db_table[Break])-1,0),0)))

so @ has been added. After I remove @ manually the formula works perfectly.

I don't know how to tell the library to not add this additional @ in the structured reference.

Is this an issue with the library or with my code?

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

No branches or pull requests

1 participant