Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

pranavgohil
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:

if(Sum(Persons)>10000000, Num(Sum(Persons)/10000000, '###.##Cr'),
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:

sortttttttttttt.PNG

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..

please help..

1 Solution

Accepted Solutions

Re: can we change sorting rule based on expression?

Hi,

maybe one solution could be:

QlikCommunity_Thread_286488_Pic1.JPG

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
mdmukramali
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

pranavgohil
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

pradosh_thakur
Honored Contributor II

Re: can we change sorting rule based on expression?

May be this

if(Sum(Persons)>10000000,alt( text(Num(Sum(Persons)/10000000, '###.##Cr'))  ,
Num(Sum(Persons)/10000000, '###.##')
),
alt(text(Num(Sum(Persons)/100000, '###.##Lacs')  ),
Num(Sum(Persons)/10000000, '###.##')
  )


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

Learning never stops.
mdmukramali
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

pranavgohil
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

pradosh_thakur
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.

Capture.PNG

Learning never stops.
pranavgohil
New Contributor III

Re: can we change sorting rule based on expression?

see this its not happening

comparrrr.PNG

pradosh_thakur
Honored Contributor II

Re: can we change sorting rule based on expression?

what about this

if(Sum(Persons)>10000000,dual( text(Num(Sum(Persons)/10000000, '###.##Cr'))  ,
Num(Sum(Persons)/10000000, '###.##')
),
dual(text(Num(Sum(Persons)/100000, '###.##Lacs')  ),
Num(Sum(Persons)/10000000, '###.##')
  )
Learning never stops.
pradosh_thakur
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.
Community Browser