SELECT TOP 3*
FROM
(SELECT
schedOverTimemins as last5,
TableNum
FROM Tables_Data_East_V2
WHERE TableNum = 5
) AS SUBQUERYB
WHERE last5 IS NOT NULL
How would I display these three values in vision horizontally? I know it's probably a simple answer, but I am stuck. I can display them vertically using a table, but I need them to display horizontally.
I've never done this and haven't tested it but I think it would be something like,
SELECT
LEFT(Last5, LEN(SUBQUERYC) - 1) AS 'Last5'
FROM
(SELECT TOP 3*
FROM
(SELECT
schedOverTimemins as last5,
TableNum
FROM Tables_Data_East_V2
WHERE TableNum = 5
) AS SUBQUERYB
WHERE last5 IS NOT NULL
) SUBQUERYC
Alteratively you could use a script transform on your existing result.
Hmm this doesn't seem to work. It states that SUBQUERYC is not a column. Honestly it seems ridiculous that vision doesn't have the option to transpose rows and columns easily or even pull multiple rows into a string.
I like the idea of using a simple expression binding to solve this problem. For example, I could add a dataset custom property to the label, and bind the property to my query. See the example below:
Once I have the data in the label's custom property, I can display the data by applying an expression binding to the text property of the label:
Well, Vision may not have script transforms built into the binding window, but you can get the effect of that by using runScript() or my objectScript() in an expression binding. Such a script can perform whatever transpose operation you like. This solution predates Perspective:
You might also find the Pseudo-SQL PIVOT from my view() expression function useful.