I use 2sxc for reasearch projects, and statistics is the most important part of the work I do. With link and visual queries I can do 90% of the work with no hassle at all. However, there are times where I need the optimized database table (with a field - value structure), for example to do a search over multiple columns on a single run (counting the number of "yes" in all questions for example). With a little fiddle I can get this type of data with the following query:
SELECT dbo.ToSIC_EAV_Attributes.StaticName, dbo.ToSIC_EAV_Values.Value
FROM dbo.ToSIC_EAV_Values
LEFT JOIN dbo.ToSIC_EAV_Attributes
ON dbo.ToSIC_EAV_Values.AttributeID = dbo.ToSIC_EAV_Attributes.AttributeID
LEFT JOIN dbo.ToSIC_EAV_AttributesInSets
ON dbo.ToSIC_EAV_Values.AttributeID = dbo.ToSIC_EAV_AttributesInSets.AttributeID
WHERE dbo.ToSIC_EAV_AttributesInSets.AttributeSetID = <my entity SetID>;
What I don't have is the knowledge to implement this on a view code in 2sxc.
How can I output the table that this query outputs?
And if I add a simple SELECT COUNT how can I place the result in a c# var?