# Qlik Sense App Development

New Contributor III

## can we change sorting rule based on expression?

hello community,

i have this doubt in my app

i created a bar chart in which i used below expression as measure:

##### Num(Sum(Persons)/100000, '###.##Lacs'))

this expression checks the value and if its greater than 1cr is appends cr after the value else it appends lacs.

after using this i'm getting following output:

#### so the problem here is it shows 35.86lacs value bar larger than 4.39cr so is there any way i can impose some rule where it will treat lacs value smaller than crore value..

Tags (2)
1 Solution

Accepted Solutions
MVP

## Re: can we change sorting rule based on expression?

Hi,

maybe one solution could be:

using this expression:

```If(Sum(Persons)>10000000,
Dual(Money(Sum(Persons)/10000000, '###.##Cr',',','.'),Sum(Persons)),
Dual(Money(Sum(Persons)/100000, '###.##Lacs',',','.'),Sum(Persons))
)
```

hope this helps

regards

Marco

14 Replies
Valued Contributor II

## Re: can we change sorting rule based on expression?

Hi Pranav,

I have followed marcowedel post to achieve it.

kindly find the attached sample app.

## 'K','Mil','Bil','Tril') are available in that application.

I think you can change to Lac & Cr

New Contributor III

## Re: can we change sorting rule based on expression?

sir can you send me the link of that exact discussion where i can find the solution of the matter..

thanks

Honored Contributor II

## Re: can we change sorting rule based on expression?

##### )

use this expression and may be if required use measure expression in the number formatting instead of auto.

Learning never stops.
Valued Contributor II

## Re: can we change sorting rule based on expression?

Hi,

Number formatting - millions to billions

check Marco Wedel @marcowedelReply in that post.

Thanks,

Mukram

New Contributor III

## Re: can we change sorting rule based on expression?

this way it shows value as 0.36 (i.e) in crores only and it doesnt even append cr at the end

Honored Contributor II

## Re: can we change sorting rule based on expression?

hi Pranav

that's why asked you to use measure expression in the formatting.

Learning never stops.
New Contributor III

## Re: can we change sorting rule based on expression?

see this its not happening

Honored Contributor II

## Re: can we change sorting rule based on expression?

##### )
Learning never stops.
Honored Contributor II

## Re: can we change sorting rule based on expression?

I have tried with dual and its working in my app.

Learning never stops.