Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sorting Not working

Dear QV Experts,

In the dashboard, we have Metrics as Dollar, Case, Each

In the list box, the expression is,

  Expression,

=If(Metrics ='Case',num(Sum({$<Date={">=$(CYStartDate)<=$(vMaxDate)"}>} CustomerCases),'#,##0'),
If(Metrics ='Dollar',num(Sum({$<Date={">=$(CYStartDate)<=$(vMaxDate)"}>} CustomerSales)/1000,'$#,##0'),
If(Metrics ='Each',num(Sum({$<Date={">=$(CYStartDate)<=$(vMaxDate)"}>} CustomerEach)/1000,'#,##0'))))


But in the Sort,


=num(Sum({$<Date={">=$(CYStartDate)<=$(vMaxDate)"}>} CustomerSales)/1000,'$ #,##0 K') 


This is working for only if Metrics selected 'Dollar'


When i add 'IF' Condition, it is not working.


If(Metrics ='Dollar', num(Sum({$<Date={">=$(CYStartDate)<=$(vMaxDate)"}>} CustomerSales)/1000,'$ #,##0 K')  ,

num(Sum({$<Date={">=$(CYStartDate)<=$(vMaxDate)"}>} CustomerCases)/1000,' #,##0 ')  ))


Can you please suggest me.


Thanks


1 Solution

Accepted Solutions
Not applicable
Author

Thanks Sudhakar. It works for me now.

Before Change,

If(Metrics ='Dollar', num(Sum({$<Date={">=$(CYStartDate)<=$(vMaxDate)"}>} CustomerSales)/1000,'$ #,##0 K')  ,

num(Sum({$<Date={">=$(CYStartDate)<=$(vMaxDate)"}>} CustomerCases)/1000,' #,##0 ')  ))


After Change,


If(Metrics ='Dollar', num(Sum({<Date={">=$(CYStartDate)<=$(vMaxDate)"}>} CustomerSales)/1000,'$ #,##0 K')  ,

num(Sum({<Date={">=$(CYStartDate)<=$(vMaxDate)"}>} CustomerCases)/1000,' #,##0 ')  ))

View solution in original post

3 Replies
Anonymous
Not applicable
Author

you give the $ symbol unnecessarily some location in your expressions

Digvijay_Singh

Can you share some sample data to recreate the issue.

Not applicable
Author

Thanks Sudhakar. It works for me now.

Before Change,

If(Metrics ='Dollar', num(Sum({$<Date={">=$(CYStartDate)<=$(vMaxDate)"}>} CustomerSales)/1000,'$ #,##0 K')  ,

num(Sum({$<Date={">=$(CYStartDate)<=$(vMaxDate)"}>} CustomerCases)/1000,' #,##0 ')  ))


After Change,


If(Metrics ='Dollar', num(Sum({<Date={">=$(CYStartDate)<=$(vMaxDate)"}>} CustomerSales)/1000,'$ #,##0 K')  ,

num(Sum({<Date={">=$(CYStartDate)<=$(vMaxDate)"}>} CustomerCases)/1000,' #,##0 ')  ))