Order dimension by number - Jira

Hello,
We have a select list in jira with the following options:
1-spain
2-latvia
3-poland
4-country
5-country
6-country
7-country
8-country
9-country
10-uk
11-italy.

When we do a report with them, they are ordered like this.
1-spain
10-uk
11-italy
2-latvia
I understand that eazybi orders them like this because it considers the numbers a text field. But, is there any way to order them according to number?

Best Regards

@Lara_LG

You can create an aggregate in your “Custom field” dimension where you define the custom rules to order the set of members by creating a calculated dmember: Calculated members in other dimensions.

In your example, you could try using regular expressions to find the integer between the “-” and use it as a number to sort members by numbers (instead of default order by string Number+text).

Try it in two steps:
step1. create new calculated member “All but none”

Aggregate( 
	Except( 
	[CF name].[CF name].Members, 
	{ 
		[CF name].[(none)]
	}
  )
)

step2: create the next calculated member

Aggregate(
  Order(
    Childrenset([CF Name].[All but none]),
    cast(
    ExtractString(
      [CF Name].CurrentMember.name,
      "(\d+)",1
    )   
    as integer),
    BASC
  )
)

Here the “CF Name” is your field name and it must be imported as dimension.

Martins / eazyBI