Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
athinadev
Partner - Contributor II
Partner - Contributor II

Qlik sense sort chart bar by expression dos not wor for small values

Hello,

I am using a bar chart with two selectable dimensions /stack, bar and two selectable measures.

The measures expressions are in variables. The percenatges should be formatted to support many languages

LET vMeasurementsTotal = Num(
Count({$<DataType*={'$(cDataType)'}, %AutoId-={'*'} >} Distinct %MasterPrimaryKey)
/ 
Count({<DataType*={'$(cDataType)'}>} total Distinct %MasterPrimaryKey)
, '0$(DecimalSep)00%', '$(DecimalSep)', '$(ThousandSep)')

 

LET vResultsTotal = Count({$<DataType*={'$(cDataType)'}, %AutoId-={'*'} >} Distinct %PrimaryKey)
/ 
Count({<DataType*={'$(cDataType)'}>} total Distinct %PrimaryKey)
, '0$(DecimalSep)00%')

 

The user selects the measure (fox example Results) and the Sorting dimension has the expression

if(GetObjectMeasure()= 'Results'
, $(vWestgardMeasurementsTotal)
, $(vWestgardResultsTotal)
)

 

The selected Chart Sorting properties are: Sort by expression, Descending - Sort numerically, Descending - Sort alphabetically, Descending

 

The sorting works but not always. If you see the screen shot I have attached it sorts by expression like this

6.71
3.86
3.09
2.90
......

0.17
0.14
0.14
0.08
0.11 that is wrong
0.08

 

What I am doing wrong? Any help?

Qlik Sense Enterprise April 2019


Thanks in advance

 

0 Replies