Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

HI Kindly help me out in the below Scenario

Hi ,

I am having the Table as

Name,Age

A,10

B,20

C,40

D,18

E,55

And I Want to Display table as

Expected Output:

Dimension should be like this in table

Dim,Count

1-25,3

25-50,1

50-75,1

75-100,0

is this possible to achieve in Apply Map()

Thanks in Advance

1 Solution

Accepted Solutions
swuehl
MVP
MVP

And if you want to create a classification in your script, you can also use the Class() function, but you can also use a mapping table like shown here:

creating an age group from a date field

View solution in original post

3 Replies
swuehl
MVP
MVP

Why do you want to use ApplyMap() here?

If you just need a chart to show your result, try a calculated dimension like

=Class(Age, 25)

and as expression

=Count(DISTINT Name)

Nicole-Smith

Using the class function in your dimension will do what you want:

=Class(Age, 25)

If you want it formatted the same way you have in your example, you can replace the default format with a simple dash:

=Replace(Class(Age, 25), ' <= x < ', '-')

Your expression would then be:

=Count(Name)

I've attached an example file with this logic implemented.

swuehl
MVP
MVP

And if you want to create a classification in your script, you can also use the Class() function, but you can also use a mapping table like shown here:

creating an age group from a date field