Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Master II
Master II

What does this expression do?

Hi All,

What does this expression do? Thanks in advance.

replace(Class(Age,5), '<= x <','-') as GroupAge,

1 Solution

Accepted Solutions
Highlighted
MVP
MVP

explain in yellow and bold in script

1.png

tmp:

load

  RowNo() as People,

  floor(rand()*100) as Age

AutoGenerate 100;

load

  *,

  replace(Class(Age,5), '<= x <','-') as GroupAge,

  Class(Age,5) as GroupAge2

Resident tmp;

DROP Table tmp;

View solution in original post

5 Replies
Highlighted
Master II
Master II

Please explain and give an example.

Highlighted
MVP
MVP

explain in yellow and bold in script

1.png

tmp:

load

  RowNo() as People,

  floor(rand()*100) as Age

AutoGenerate 100;

load

  *,

  replace(Class(Age,5), '<= x <','-') as GroupAge,

  Class(Age,5) as GroupAge2

Resident tmp;

DROP Table tmp;

View solution in original post

Highlighted
Master II
Master II

Hi maxgro

Thank you so much. I got it.

Highlighted
MVP & Luminary
MVP & Luminary

Hi,

Class() is used to group the values with the specified ranges or called it as Buckets. 

replace(Class(Age,5), '<= x <','-') as GroupAge

The above script creates the age group with the interval of 5, when you do this you will the format like

5 <= x < 10 to remove the symbols between the we use the Replace().

HOpe this helps you.

Regards,

Jagan.

Highlighted
Master II
Master II

Hi jagan

Thank you for detail explanation.