Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Line charts resorting months on click

On a line chart I have, months (Apr, May, Jun, ...etc) is resorting when a month is clicked on (ex. Jan, Feb, Mar,.....Dec, Apr). I need the date to remain (Apr, May, Jun, .... etc).

1 Solution

Accepted Solutions
jerem1234
Valued Contributor II

Re: Line charts resorting months on click

Try enclosing the expression you are sorting with by only and with ignoring selections like:

only({1}bPeriod)

Hope this helps!

8 Replies
manojkvrajan
Contributor III

Re: Line charts resorting months on click

Paul - Clear all check boxes and Check ONLY Text A -> Z as mentioned below and see if that works.

Sort BY Text AtoZ_and_UncheckAllOptions.PNG.png

Re: Line charts resorting months on click

Hi Paul,

do not use "text" but "numeric" sorting if the months result from timestamps or dates and thus are numeric.

regards

Marco

Not applicable

Re: Line charts resorting months on click

In mine I have expression as Ascending with bPeriod in the box under the expression and Numeric value as Ascending. As in my note, bPeriod = (Apr,may, Jun, Jul, Aug, ....).  This seems to make a difference.

Not applicable

Re: Line charts resorting months on click

load an inline table before your loading your calendar table as below

(give month names in the order you wanted.

load Monthinline

[

Month

Apr

May

Jun

................

];

you can delete this table once your calendar is loaded.

now in your chart use 'Load order = Original ' as your sorting

Re: Line charts resorting months on click

you are saying the sort order you expect is and remains "Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec, Jan, Feb, Mar" and is defined by your expression bPeriod?

Then if bPeriod changes, the sorting order of the Month dimension also changes.

You could check the sort-by-expression check box and use a static expression like

if(Month > 3, Month-3, Month+9)

instead (also unchecking every other check box and provided your Month field is indeed numeric)

This way you would stick to the order "Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec, Jan, Feb, Mar" regardless of any selections.

regards

Marco

jerem1234
Valued Contributor II

Re: Line charts resorting months on click

Try enclosing the expression you are sorting with by only and with ignoring selections like:

only({1}bPeriod)

Hope this helps!

Not applicable

Re: Line charts resorting months on click

This worked.

Thank you.

Not applicable

Re: Line charts resorting months on click

only({1}bPeriod) did work.

Community Browser