Sorting of result works in Query Designer but not when I run the report
-
Monday, March 04, 2013 8:32 AM
Hello,
in the query below, the sorting does not seem to work. When I run the query in Query Designer, the values come out correct with the highest value on top, but when I run it in preview it does not. Why?
SELECT ie.Market AS Marknad, ie.[Sales Area_Buyer] AS Distrikt, ie.Statisticscustomer_Supplierno_ AS KundNr, cu.Name, SUM(ie.[Src_ Curr_ Amount]) * - 1 AS 'local'
FROM [Table1] AS ie INNER JOIN
[Table2] AS cu ON cu.Market = ie.Market AND cu.No_ = ie.Statisticscustomer_Supplierno_
WHERE (ie.Market = @Marknad) AND (ie.[Sales Area_Buyer] = @Distrikt)
GROUP BY ie.Market, ie.[Sales Area_Buyer], ie.Statisticscustomer_Supplierno_, cu.Name
ORDER BY 'local' DESC
All Replies
-
Monday, March 04, 2013 9:02 AM
Hi SPEHE,
If you are populating the data on tablix, Can you please check there is no sorting expression been placed on the tablix.
To set the sorting on Tablix, please follow this msdn link. -> http://msdn.microsoft.com/en-us/library/cc627478(v=sql.100).aspx.
Regards Harsh
-
Monday, March 04, 2013 9:05 AM
Hello Harsh,
thank you for taking your time to help me. I forgot to mention that I am population a chart ( Horisontal bars) and I would like the longest bar to be on top.
regards,
Peter
-
Monday, March 04, 2013 9:18 AM
Hi SPEHE,
To sort data on chart please follow this steps as mentioned in MSDN (Original link address - > http://msdn.microsoft.com/en-us/library/ms157462(v=sql.100).aspx )
To sort the data points in ascending or descending order on a chart
-
Right-click a field in the Category Field drop zone and click Category GroupProperties.
-
In the Category Group Properties dialog box, click Sorting.
-
For each sort expression, follow these steps:
-
Click Add.
-
Select the expression that matches your data field. In most cases, this is an aggregated value, such as =Sum(Fields!Quantity.Value).
-
From the Order column drop-down list, choose the sort direction for each expression. A-Z sorts the expression in ascending order. Z-A sorts the expression in descending order.
-
-
Click OK
Regards Harsh
- Marked As Answer by SPEHE Monday, March 04, 2013 11:56 AM
-
-
Monday, March 04, 2013 11:56 AMYes, that was correct. Thank you for your help.

