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

Dimention grouping

Hi all,

My question pertains to grouping in the dimentions. How is that done? is there a specific code for it?

For example i have a dimension 'Number of months' and another field ' number of customers'. What I have to do is make a chart which doesnt show the Number of months but it shows RANGES. e.g. upto 3 months, supto 6 months, upto 10 months and so on.

the bar chart should show the number of consumers which have due ' upto to 3 months' etc.

Help regarding this is much apprecaited. \

thanks!

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Maybe Class() could be the thing you are looking for?

class( expression, interval [ , label [ , offset ]] )

Creates a classification of expressions. The bin width is determined by the number set as interval. The result is shown as a<=x<b, where a and b are the upper and lower limits of the bin. The x can be replaced by an arbitrary string stated in label. 0 is normally the default starting point of the classification. This can be changed by adding an offset.



View solution in original post

6 Replies
Anonymous
Not applicable
Author

Maybe Class() could be the thing you are looking for?

class( expression, interval [ , label [ , offset ]] )

Creates a classification of expressions. The bin width is determined by the number set as interval. The result is shown as a<=x<b, where a and b are the upper and lower limits of the bin. The x can be replaced by an arbitrary string stated in label. 0 is normally the default starting point of the classification. This can be changed by adding an offset.



Not applicable
Author

Hi,

If you want to use automatic same-length intervals, you can use class() function as a calculated dimension. This is an example:

=floor(number_of_months,3)

This will create automatic 3-month intervals from number_of_months field.

Otherwise, if you like to specify your own intervals, you have to use intervalmatch clause in script, to connect your intervals to number of month field. Usage is like this:

table1:

Load id, number_of_months from Whatever;

table2:

LOAD * INLINE [

from, to, name

0, 50, 0-50

51, 100, 51-100

101, 10000, 101 and more

];

left join (table1)

intervalmatch (number_of_months)

Load from,

to

resident table2;



Than you will have your own intervals named 0-50, 51-100 and 101 and more connected to table with number of months. When doing intervalmatch join, you need to have all needed field already loaded in qlikview.

Hope this helpes:)

Tomas



Not applicable
Author

Tomas, i used floor function it made a different field which gives me two values of -1 and 0 but no intervals. where do i have to write the function in the edit script?

can u tell me where i have gone wrong?

Not applicable
Author

also, why not 'groupby' cannot be used?

Not applicable
Author

also, the floor function does not display the desired result. it does not create a range it only displays bars every 3 months. i want the display to be cumulative. upto 3 months. then from 3 to 6 months so on and so forth,

please guide me thanks

Not applicable
Author

Hi, my mistake:), I wrote "floor", but I ment "class" function (as described before). I am very sorry. I often confuse these two, but I really don't know why.