By popular request, I've created this topic to be used in wiki mode for collaborative generation of solutions to particular problems. To keep this neat, please follow these guidelines:
New problems seeking solutions should be posted as replies, and the discussion of that problem kept within that comment, wiki-style. A one-line summary should be added to this topic starter, with an embedded link (not on its own line). After posting, be sure to convert the comment to operate in wiki mode.
Use the "Hide Details" tool to keep the one comment neat. In particular, code blocks belong inside the details.
Create a "uses" details section at the end of a problem/solution comment where you deep link into the public module documentation for each function or feature used in the solution. Consider also deep linking into the IA manual, too.
Perspective Table Data and Columns Config from Datasets
When using the JSON return format in a Named Query, the column order and original column datatypes are lost. You can move a Named Query binding to a custom property of the component or view, then use this simple iteration expression to deliver the jsonified content to the table:
Creating a custom property dataset using a temporary binding
There isn't a built-in method to create a dataset in a Perspective custom property. Creating an Expression Binding with this script will generate one. The binding can then be removed leaving the dataset.
unionAll() Assembles an output dataset from scratch, using the given column names and types (internally via a DatasetBuilder), performing a UNION ALL with each row source.
asList() unconditionally assembles all of its arguments into a List.
You really only need to create one column with the binding and then modify the result with the Dataset Editor. (Click the icon to the right of the Dataset [...].)
Many times you want to filter a dataset where a columns value is equal to one of any item in a list. In SQL this is possible by utilizing the 'IN' operator. However, outside of using a QueryString parameter, due to the way that Named Query parameters work you can not supply a List of values.
If you create a custom property to hold the raw data set from the named query, then you can use a simple expression binding to filter the dataset further in a similar manner to that seen when using the SQL IN operator.