Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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
MarcoWedel

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

View solution in original post

14 Replies
mdmukramali
Specialist III
Specialist III

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

Anonymous
Not applicable
Author

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

thanks

pradosh_thakur
Master II
Master II

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
Specialist III
Specialist III

Hi,

Number formatting - millions to billions

check Marco Wedel @marcowedelReply in that post.

Thanks,

Mukram

Anonymous
Not applicable
Author

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

pradosh_thakur
Master II
Master II

hi Pranav

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

Capture.PNG

Learning never stops.
Anonymous
Not applicable
Author

see this its not happening

comparrrr.PNG

pradosh_thakur
Master II
Master II

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
Master II
Master II

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

Learning never stops.