Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
edwin_jow
Partner - Contributor
Partner - Contributor

Class function on decimal numbers

Hi all,

I'm trying to use the Class function to segment out a field that is a decimal value.  If the decimal is <= .85 show 85, if decimal >= 120 show 120.

For some reason I'm running into a problem where QlikSense doesn't seem to be recognizing some of the values in the set, particularly the data from .85 to .9 as a calculated dimension.  If I apply the same formula as a measure, it seems to segment the data correctly. 

Set up script:

[Test]:
LOAD *
INLINE [
    Test
    209.843
    22.329
    23.135
    23.610
    24.680
    27.037
    28.037
    28.070
    30.313
    32.858
    34.696
    35.707
    36.911
    38.336
    38.631
    38.676
    44.062
    46.314
    47.641
    47.940
    47.970
    53.908
    54.151
    58.659
    59.265
    59.775
    65.924
    66.391
    66.720
    67.125
    67.145
    67.296
    72.839
    73.684
    74.866
    74.903
    75.306
    75.558
    78.329
    79.410
    79.817
    79.851
    80.381
    82.186
    82.637
    84.147
    87.913
    88.744
    90.083
    90.212
    90.945
    91.825
    92.244
    92.984
    93.047
    93.089
    93.158
    94.045
    94.984
    95.111
    95.693
    95.809
    95.814
    95.903
    96.230
    96.414
    96.613
    96.734
    96.785
    98.563
    99.037
    100.017
    100.230
    100.301
    100.590
    100.861
    100.955
    101.172
]

Function:

=IF(Test <= 85, '85', IF(Test >= 120, '120+', Class(Test, 5)))

Result:

Capture.JPG

I feel like I'm missing something stupid.  On the left is the function as a calculated dimension.  On the right is the function as a measure.  The right side properly displays 85 <= x < 90 but the left is coding as 85.

Thoughts?

Thanks,

Edwin 

0 Replies