Using QGIS expressions, if you have an array, you can get the n-th element by simply adding a number (n) in square brackets (starting with 0 for the first element). Like this, array (1,2,3,4,5,6,7,8)[2]
returns 3
(element no. 2/third element).
Is there a way to retrieve more than one element in this way with QGIS expressions?
What I tried, based on similar options in R, but doesn't work here:
array (1,2,3,4,5,6,7,8)[2,3]
-- to retrieve elements 2 and 3
array (1,2,3,4,5,6,7,8)[array(2,5)]
-- to retrieve elements 2, 3 and 5