dosubot[bot] commented on issue #33274: URL: https://github.com/apache/superset/issues/33274#issuecomment-2839199924
<!-- Greeting --> Hello @ksnikiforov! I'm [Dosu](https://dosu.dev), here to assist you with bugs, questions, and contributing tips while you wait for a human maintainer. Let's get this sorted out together! <!-- Answer --> The issue you're experiencing with the "First" and "Last" aggregate functions in pivot tables is due to their implementation, which does not consider the order of the dataset. These functions are designed to act like "Min" and "Max" by selecting the first and last elements of the series based on the current order, without taking into account any sorting applied in the UI. The "SORT BY" field in the UI does not affect this behavior unless the dataset is explicitly sorted before applying these functions <sup>[[1]](https://github.com/apache/superset/blob/master/superset/charts/client_processing.py)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/6977cfea-235a-423e-9c45-ad5bbec3f335?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/6977cfea-235a-423e-9c45-ad5bbec3f335?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/6977cfea-235a-423e-9c45-ad5bbec3f335?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/6977cfea-235a-423e-9c45-ad5bbec3f335?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/6977cfea-235a-423e-9c45-ad5bbec3f335?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/6977cfea-235a-423e-9c45-ad5bbec3f335?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/6977cfea-235a-423e-9c45-ad5bbec3f335?feedback_type=other)</sup> -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
