Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Smoothing a Line Graph

Hello,

I am looking to map out several customers' credit scores on a line graph. The credit score will be on the x axis and the count of customers will be on the y axis. Since there are so many possible credit scores, the line graph looks very jagged. I was able to make it look smoother by rounding all of the credit scores to the nearest 10th, so if the score is 778 it rounds to 780. Although this made the graph look the way I needed it to, the values on the y axis were inflated because of more customers falling into each rounded bucket. Is there a way for me to replicate what I did by rounding while keeping the y axis the same as before rounding?

Thanks

8 Replies
Anil_Babu_Samineni

Matther,

Can you please share the sample aplication.

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
effinty2112
Master
Master

Hi Matthew,

                         Suggest you look at the Class function. This allows you to group your credit scores into fixed width classes or bins. Your dimension would be a calculated dimension something like:

Class([Credit Score],10)

This would group the credit scores into 'bins'

0<Credit Score <=10

10<Credit Score <=20

etc.

In this case 10 is the width of your bin which might be sensible if your scores run from 0 to 100, not so good if they run from 0 to 1.

Your expression could be something like Count(CustID).

Good luck

Andrew

Not applicable
Author

This works, but it still increases the y axis. Is there a way to keep the y axis the same as it would be before placing the values into classes?

effinty2112
Master
Master

Hi Matthew,

If the chart is telling the truth then we must have some respect for what it shows us. However here are a couple of suggestions:


You can increase the size of the classes, that should help to even out the peaks and troughs.


If you think the users would be able to properly interpret it in the Axes tab of the chart you could change your expression axis to a Log Scale and check the Show Grid option. That will make the highs and lows look less extreme but your audience will need to be made clear that the scale is not linear - a bar twice the height of another represents a ratio of 10:1.

Cheers

Andrew

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Try checking "Continuous" property on the Axis pane.

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

MarcoWedel

Hi,

you could try with a moving average using a RangeAvg(Above(...)) expression.

This should neither change the number of dimension values nor the expression axis while smoothing the line graph.

see also: RangeAvg ‒ QlikView

hope this helps

regards

Marco

johnw
Champion III
Champion III

Divide the result by 10? Or whatever you use as your class width.

johnw
Champion III
Champion III

Here's an application with random sample data and the various approaches that have been suggested and one more. Sample data for anyone else that wants to play.

Edit: Oh, and don't use the "accumulate 20 steps back, divide by 20" that I added. It pushes the curve to the right, thus inflating the average credit score.