Qlik Community

App Development

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

Announcements
QLIKWORLD LIVE! MAY 16 - 19TH, EARLY BIRD DISCOUNTS! REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
athinadev
Partner
Partner

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