5 Replies Latest reply: Jan 24, 2011 1:59 PM by John Witherspoon

# How to group data as ranges on x-axis?

Hi All,

I'm new to QlickView and was wonderiing if anyone can help with a query of mine.. (I have attached an example for reference)

To illustrate I have the following load command:

INLINE [
Revenue, Days,
10, 1
9, 2,
10, 3,
6, 4,
5, 5,
6, 6
];

Now I've generated the a graph with Revenue as a dimension and created an expression that counts the frequency of Revenue to Days.

Is there a way to group the data into ranges? so for example, instead of having 5,6,9,10, I can group it into 5-6 and 9-10 and also sum up the frequency in these ranges?

Any help would be appreciated.

Thanks.

• ###### How to group data as ranges on x-axis?

Hi Mob,

This can be done by using "interval matching" functionality of QlikView. Just go through this topic in the reference manual and you will get to know how to implement this functionality.

Best Regards

• ###### How to group data as ranges on x-axis?

You could do it with a calculated dimension. If your ranges should always be the same width, you can use the class() function. For instance, you could replace your dimension with:

class(Revenue,2,'Revenue',1)

If your ranges aren't even, or if you don't like how class() presents the data, you could replace your dimension with something like this:

if(Revenue<=6,dual('0-6',6),if(Revenue<=10,dual('6-10',10),dual('>10',11)))

• ###### How to group data as ranges on x-axis?

Thanks guys,

Both suggestions were excellent.

• ###### How to group data as ranges on x-axis?

Thanks -- I will try this out.

• ###### How to group data as ranges on x-axis?

`vijaydop wrote:Thanks -- I will try this out.`

I'll mention that I wouldn't suggest my solution any more. I dislike calculated dimensions, primarily from a performance perspective. Instead, I'd now suggest using one of those expressions during the load to build a "Revenue Range" field, or something along those lines. That moves any performance hit into the load, where it doesn't affect response time to the users.