You can translate the question and the replies:

Should be able to load with complex arrays

Hi, I have a question on top of https://community.denodo.com/answers/question/answered/details?questionId=90670000000CcQPAA0 In the question there is a way to list dates. But if we have the same case where we had both start and end date then how can we group both of them in the list? For example name lastname datelist _______________________________ Der S Liang array Charlene Liem array Roger Ounis array where the array should be holding two columns (Start and end dates). Can you please let us know the possibility? Thanks
user
22-01-2015 18:00:02 -0500

1 Answer

Hi, The NEST() function can be used to return an array containing the values of the selected fields. For instance, take this table below: name lastname start_date end_date ________________________________________________________________ Der S Liang Fri Aug 30 Sat Aug 31 Der S Liang Mon Sep 30 Tue Oct 1 Der S Liang Wed Nov 30 Thu Dec 1 Charlene Liem Thu Jan 30 Frd Jan 31 Roger Ounis Mon Dec 01 Tue Dec 02 Roger Ounis Tues Dec 02 Wed Dec 03 To return the start_date and end_date fields in a list, create a selection view that groups by 'name' and 'lastname'. Also add a new field 'datelist' that uses the nest function over start_date and end_date. For instance: CREATE OR REPLACE VIEW p_bv_product_invoice AS SELECT name AS name, lastname AS lastname, nest(start_date, end_date) AS datelist FROM bv_product_invoice GROUP BY name, lastname; name lastname datelist _______________________________ Der S Liang array Charlene Liem array Roger Ounis array The 'datelist' array is structured the following way: start_date end_date ______________________ Fri Aug 30 Sat Aug 31 Mon Sep 30 Tue Oct 1 Wed Nov 30 Thu Dec 1 Hope this solution helps.
Denodo Team
23-01-2015 15:05:22 -0500
You must sign in to add an answer. If you do not have an account, you can register here