You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "srinidhirao (via GitHub)" <gi...@apache.org> on 2024/05/15 11:22:31 UTC

[I] How to customize the row number in the exported excel file? [superset]

srinidhirao opened a new issue, #28511:
URL: https://github.com/apache/superset/issues/28511

   ## Screenshot
   1. Try to download data as excel sheet from any chart.
   
   ![image](https://github.com/apache/superset/assets/9901457/dfd67a9c-43b8-44c6-b108-a40571e28c91)
   
   2. Check the resulting excel sheet. Checkout the left most column.
   
   ![row_number](https://github.com/apache/superset/assets/9901457/83207a5a-ecea-4b49-87ad-a8dfb86a98ba)
   
   ## Description
   
   When you export the data from any of the superset charts, its adding a row number column which starts with 0. Anyway we can customize this to start from 1? 
   
   I'm on version 3.0.1.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] How to customize the row number in the exported excel file? [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas closed issue #28511: How to customize the row number in the exported excel file?
URL: https://github.com/apache/superset/issues/28511


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] How to customize the row number in the exported excel file? [superset]

Posted by "srinidhirao (via GitHub)" <gi...@apache.org>.
srinidhirao commented on issue #28511:
URL: https://github.com/apache/superset/issues/28511#issuecomment-2112323153

   Is there a way to update DataFrame's index from Apache Superset?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] How to customize the row number in the exported excel file? [superset]

Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #28511:
URL: https://github.com/apache/superset/issues/28511#issuecomment-2112294506

   <!-- Answer -->
   To customize the row number in the exported Excel file to start from 1 instead of 0, you'll need to adjust the DataFrame's index before exporting it. This is because the row numbers in the Excel file are generated from the DataFrame's index, which by default starts at 0. Here's how you can modify the index:
   
   ```py
   df.index += 1
   ```
   
   Adding this line before the DataFrame is exported to Excel will shift all the row numbers up by one, making them start from 1. This change needs to be made in the codebase where the DataFrame is prepared for export. If you're unable to modify the codebase yourself, you might need to request this feature from the software maintainers.
   
   Keep in mind, this adjustment will affect all Excel exports from the software, not just a specific case. If you need this customization for specific exports only, a more tailored solution will be necessary.
   
   
   <!-- Dosu Comment Footer -->
   <details open>
   <summary>
   
   #### Details
   </summary>
   
   **Sources**
   - [superset/utils/excel.py](https://github.com/apache/superset/blob/master/superset/utils/excel.py)
   - [superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.jsx](https://github.com/apache/superset/blob/master/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.jsx)
   - [superset-frontend/packages/superset-ui-core/src/currency-format/utils.ts](https://github.com/apache/superset/blob/master/superset-frontend/packages/superset-ui-core/src/currency-format/utils.ts)
   - [superset/databases/schemas.py](https://github.com/apache/superset/blob/master/superset/databases/schemas.py)
   - [superset-frontend/src/dashboard/components/gridComponents/Chart.test.jsx](https://github.com/apache/superset/blob/master/superset-frontend/src/dashboard/components/gridComponents/Chart.test.jsx)
   
   <br/>
   
   **About Dosu**
   This response is meant to be useful and save you time. It is **not meant to be a precise solution**, but rather a starting point for your own research.
   
   Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
   </details>
   
   *To continue the conversation, mention @dosu.*
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org