sql - Sorting in a matrix SSRS -


i try sort machine number ascending. if took out prduct description machines sorted ascending. show product description every machine , show machines sorted(m101,m102,m103...)

enter image description here

where date between @startdatetime , @enddatetime     , name in ('m101','m102','m103','m104','m105','m106','m107','m108','m109','m110', 'm111')      group date, name, productname      ) s  order name asc 

it should here:

enter image description here

enter image description here did used matrix

[![enter image description here][4]][4]

i have try these 2 solution

first use case when in order clause

order case          when name = 'm101' 1          when name = 'm102' 2     end  

it's not best solution it's can solved problem , second solution use substring in order clause this

order cast(substring(name,2,10) int) 

and if use column group dynamic expand column don't forget delete delete sorting condition. hope it's help


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -