Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

creating a number band

Hi, in my records I have a numeric field named 'SumInsured'.

What I need to do is to band all the records according to the SumInusured field.

Example, I need to have the following:

BandRecord Count
1 -1000010
10001 - 2000050
20001 - 300005

Any ideas on how I can go about this please?

1 Solution

Accepted Solutions
AbhijitBansode
Specialist
Specialist

Use calculated dimension using Class function:

Class(SumInusured , 10000)

it will by default return ranges in format '<= x <'

you can use Replace function on top of it to get the required format:

Replace(Class(SumInusured , 10000), '<= x <', ' - ')

View solution in original post

8 Replies
Not applicable
Author

Hi,

You can use AGGR function to get count of records according to SumInsured field. Might be something like this:

Aggr(Count(Cust_ID), SUMINSURED)

Here Cust_ID being the field which you want to count.

Hope this helps!

Not applicable
Author

Hi Shyamal, what I need to know is how to allocate the SumInsured field to a Band

sujeetsingh
Master III
Master III

just create a new field in your script as

if(Sum(SUMINSURED)>0 and Sum(SUMINSURED)>100,'0-1000')

Hence you can use it in nested if expression or else just assign a value to  it.

Not applicable
Author

Hi,

You can use the class function if you have fixed intervals:

Class(SumInsured, 10000).

If you need to achieve that based on the sum by Cust_ID according to your current selections, you can do it like this:

Class(Aggr(Sum(SumInsured), Cust_ID), 10000)

Hope this will help you.

Not applicable
Author


Hi Jean-Pierre, Class function seems to be what I am looking for.  Do you add the class function in the script or in an expression?

AbhijitBansode
Specialist
Specialist

Use calculated dimension using Class function:

Class(SumInusured , 10000)

it will by default return ranges in format '<= x <'

you can use Replace function on top of it to get the required format:

Replace(Class(SumInusured , 10000), '<= x <', ' - ')

Not applicable
Author

You can use this function also from the script.

But what I've suggested is to use it in your dimension, to be dynamically changed based on your selections.

basav
Creator
Creator

Class(Aggr(Sum(SumInsured), Cust_ID), 10000, '-'). Slight modification.