Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

problems with the scale on x-axis

Hi there

I built up a linechart about the Net Sales of my company (expressions) and with the dimension "Date" .

The problem is, that the graph isn`t able to show the hole timeperiod on the x-axis, due to space restriction on my sheet. Unfortunately, it cuts out the most recent data instead of either the oldest one or to minimize the graph.

Exp: it shows data from September 2009 until November 2010 instead until today.

Idea 1: show data from MM.YYYY until today

Idea 2: show September 2009 until today (and minimize the graph)

As I am a new user in QlikView with no experience with BI systems and with no help within the company, I am very lost.

Does someone has an idea how to solve that?

Kind regards

Julia

1 Solution

Accepted Solutions
Not applicable
Author

You can force the chart to be scrolled right by creating a button with an action to RunMacro as below (change CH125 to whatever your chart ID is). You only need to do it one (so delete the button after clicking it):

sub OneOff

set chart = ActiveDocument.GetSheetObject("CH125")
set p = chart.GetProperties
p.ChartProperties.XScrollInitRight = true
chart.SetProperties p

end sub

Regards,

Gordon

View solution in original post

11 Replies
Not applicable
Author

In the Presentation tab of your object, put a tick box in (right-top corner) Max Visible Number (this limits the amount of X-axis values shown at any one time) and state a value, say 20. Put a tick box in Show X-axis Scroll bar, this will give a scrollbar to move around the X-axis values and if you want to show the latest values whenever you open the chart obejct, put a tick box in Reversed. This ensures the scroll bar will always be towards the right, as opposed to the default left.

Not applicable
Author

Thanks so much for your qick answer.

The first points went well. But the thing with "reversed" makes no change on my chart. It still begins with the oldest data (before scrolling to the right side)

Not applicable
Author

Hi,

You need sorting for this.

Go to sort tab in properties and click numeric check box with descending order or use expression.

Reg,

Shubhu

Not applicable
Author

That wasn´t my intention. the newest date should stay on the right side of my graph. but thanks as well!

I wish, that it shows directly the newest data if it has not enough space for showing all of it.

Not applicable
Author

You can force the chart to be scrolled right by creating a button with an action to RunMacro as below (change CH125 to whatever your chart ID is). You only need to do it one (so delete the button after clicking it):

sub OneOff

set chart = ActiveDocument.GetSheetObject("CH125")
set p = chart.GetProperties
p.ChartProperties.XScrollInitRight = true
chart.SetProperties p

end sub

Regards,

Gordon

Not applicable
Author

Hi Gordon

Thanks, that sounds very good! Unfortunately, I did not figure out how to create a button :-S I am really a raw recruit!

Regards

Not applicable
Author

Right click on the sheet>New Sheet Object>Button>Actions tab>Add>Action Type = External, Action=Run Macro>OK>MacroName = OneOff>OK

Click the button to run the macro, then delete the button (you can also delete the macro from 'Edit Module' but you might want to keep it for reference)

Regards,

Gordon

Not applicable
Author

...to add the macro code just click the 'Edit Module' icon on the toolbar, paste the code in (changing the chart ID) then click OK

Not applicable
Author

Thanks! Now I know why I did not find the "button" funktion. It has a weird name in german.

I was able to create the button and to add the macro code. But in the end, the action isn´t working (the scroll bar is still on the left side)

😞

Regards