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

XLSX export of "X of Y" (eg. Month of Year) is formatted as date column #18729

Closed
flamber opened this issue Oct 28, 2021 · 4 comments · Fixed by #21048
Closed

XLSX export of "X of Y" (eg. Month of Year) is formatted as date column #18729

flamber opened this issue Oct 28, 2021 · 4 comments · Fixed by #21048
Assignees
Labels
.Correctness Priority:P3 Cosmetic bugs, minor bugs with a clear workaround .Regression Bugs that were previously fixed and/or bugs unintentionally shipped with new features. Reporting/Export .Reproduced Issues reproduced in test (usually Cypress) Type:Bug Product defects
Milestone

Comments

@flamber
Copy link
Contributor

flamber commented Oct 28, 2021

Describe the bug
XLSX export of "X of Y" (eg. Month of Year) is formatted as date column.

Workaround: In they XLSX viewer (Excel, Numbers, Calc), disable date formatting on the column.

To Reproduce

  1. Custom question > Sample Dataset > Products
  2. Count grouped by CreatedAt:MonthOfYear and Category
    image
  3. Export as XLSX
    image
  4. Export as CSV
Created At,Category,Count
1,Doohickey,2
1,Gadget,7
1,Gizmo,6
1,Widget,1
2,Doohickey,4
2,Gadget,5
2,Gizmo,4

Expected behavior
Preferably return the value similar to what is shown in Metabase (this might be tricky, especially with i18n), otherwise return the numeric value without date formatting.

Information about your Metabase Installation:
Tested 0.40.5 thru 0.41.1 - regression since 0.41.0

Additional context
Lightly related to #18572 and #18219

@flamber flamber added Type:Bug Product defects Priority:P3 Cosmetic bugs, minor bugs with a clear workaround .Correctness Reporting/Export .Regression Bugs that were previously fixed and/or bugs unintentionally shipped with new features. labels Oct 28, 2021
@nemanjaglumac
Copy link
Member

nemanjaglumac commented Nov 1, 2021

@flamber this is what SheetJS sees for xlsx. Not sure which assertion would be appropriate because we're still not sure how will this be resolved. Any ideas?

{
    "A1": {
        "t": "s",
        "v": "Created At",
        "h": "Created At",
        "w": "Created At"
    },
    "B1": {
        "t": "s",
        "v": "Product → Category",
        "h": "Product → Category",
        "w": "Product → Category"
    },
    "C1": {
        "t": "s",
        "v": "Count",
        "h": "Count",
        "w": "Count"
    },
    "A2": {
        "t": "n",
        "v": 1,
        "w": "January 1, 1900, 12:00 AM"
    },
    "B2": {
        "t": "s",
        "v": "Doohickey",
        "h": "Doohickey",
        "w": "Doohickey"
    },
    "C2": {
        "t": "n",
        "v": 408,
        "w": "408"
    },
    "A3": {
        "t": "n",
        "v": 1,
        "w": "January 1, 1900, 12:00 AM"
    },
    "B3": {
        "t": "s",
        "v": "Gadget",
        "h": "Gadget",
        "w": "Gadget"
    },
    "C3": {
        "t": "n",
        "v": 452,
        "w": "452"
    },
}

@nemanjaglumac
Copy link
Member

Also, please let me know if you'd like this covered for csv as well?

@flamber
Copy link
Contributor Author

flamber commented Nov 1, 2021

@nemanjaglumac I'm not sure if we're able to do similar translation as in-app, but otherwise it should return numeric value similar to CSV. And given the regression, then we should also cover CSV, so we don't regress there too.

nemanjaglumac added a commit that referenced this issue Nov 1, 2021
@nemanjaglumac nemanjaglumac added the .Reproduced Issues reproduced in test (usually Cypress) label Nov 1, 2021
github-actions bot pushed a commit that referenced this issue Nov 1, 2021
nemanjaglumac added a commit that referenced this issue Nov 1, 2021
…d as date column (#18792) (#18794)

Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
@noahmoss
Copy link
Member

Unassigning myself; when I started to dig into this it seemed pretty tricky to get exactly right. More of a mini project than a quick fix IMO

This was referenced Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
.Correctness Priority:P3 Cosmetic bugs, minor bugs with a clear workaround .Regression Bugs that were previously fixed and/or bugs unintentionally shipped with new features. Reporting/Export .Reproduced Issues reproduced in test (usually Cypress) Type:Bug Product defects
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants