Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

question in Qlik sense

2 columns in table:

one column :unit no. (i.e 34243) and the second : corresponding distance data (i.e 1.1767).

Need:

To write for each distace range (0-1, 1.5-2) how many units there are in that range.

What query do i have to use in the expression editor?

thanks in advance!

5 Replies
Not applicable
Author

Dimension:

class(Distance)

Measure: count(UnitNo)

I.e. you use a calculated dimension.

Not applicable
Author

can you help me with syntax of class? for example if i want  between the range 1-1.5 miles

Not applicable
Author

If you want each half mile, and the Distance field is in units of Miles, then

class(Distance, 0.5)

will work.

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this in script

LOAD

*,

If(distance > 1.5 AND distance <=2, '1.5-2',

     If(distance >0 AND distance <= 1, '0-1', 'Other')) AS Range

FROM DataSource;

Now in just use this

Dimension: Range

Expression: Count(UnitNo)

Hope this helps you.

Regards,

Jagan.

Not applicable
Author

you gave me this solution and it worked:


class(Distance, 0.5)


Now instead of Distance data  I created calc dimension which called CalcDist, in Qlik sense


But if Now I change the name of the field in the command:


class(CalcDist, 0.5)


it says it is bad field name..


any advise??