You can translate the question and the replies:

Query to Return Summary and Last Record as One Row

I'm struggling to write a query which returns a single row with summarized data and the last instance of an event. Scenario: Let's say I have a customer table and a sales transaction table. I need to write a query which returns the Total Sales by Customer along with the Date and Dollar amount of their Last Transaction. In SQL Server server, i could use either cross apply or rank() functions. Unfortunately, this data comes from a webservice, so i cannot push this logic to the source system. Thank you, John
user
06-02-2019 10:53:00 -0500

1 Answer

Hi, Virtual DataPort Server delegates the [RANK()](https://community.denodo.com/docs/html/browse/7.0/vdp/vql/appendix/syntax_of_condition_functions/analytic_functions_window_functions#rank) function to the underlying datasource. But in your scenario, a web service cannot process this function so I would suggest to refer a similar Q&A [here](https://community.denodo.com/answers/question/details?questionId=9060g0000004EzeAAE&title=RANK+Function) which explains in detail how to use the rank() function. Regarding Cross Apply join, Denodo does not have this operator but supports the functionalities of the Cross apply join. For more details you may refer to similar community Q&A [VQL support for CROSS APPLY](https://community.denodo.com/answers/question/details?questionId=9060g000000fzrDAAQ&title=VQL+support+for+CROSS+APPLY). Hope this helps!
Denodo Team
07-02-2019 03:59:28 -0500
You must sign in to add an answer. If you do not have an account, you can register here