Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Create a bar chart sorted by month

Hi, I 'm new in qlikview.  I have different dates in one of the column and i would like to create a bar chart sorted by month. I appreciate if anyone can help me

thanks in advance

12 Replies
oknotsen
Master III
Master III

Dates are usually stored as number (though showing as date). I suggest sorting your chart on that column by number.

May you live in interesting times!
MarcoWedel

please post sample data/application to demonstrate with.

regards

Marco

Peter_Cammaert
Partner - Champion III
Partner - Champion III

You will have to calculate a month value from your date column in your load script, like

LOAD ...

     DateColumn,

     Month(DateColumn) AS MonthColumn,

     :

     Amount

FROM whereveryouwant (options);

Now you can create a bar chart with dimension MonthColumn and expression =sum(Amount).

Alternatively, you could create a calculated dimension =Month(MonthColumn) and use it with the same sum expression. But that won't be the most efficient solution (performance-wise). The script solution is the-right-thing-to-do.

Best,

Peter

ecolomer
Master II
Master II

Hi,

I attached you an exmaple (but is in spanish language. I'm sorry).

P67.png

mightyqlikers
Creator III
Creator III

hi

create an inline table with month and month_num field with 1 to 12 .

then sort by month_num

Regards

$@M.

HirisH_V7
Master
Master

Hi ,

Data:

LOAD * ,

Month(Date) As Month,

Num(Month(Date)) as MonthNum

INLINE [

    Date, Sales

    01/01/2015, 1

    01/02/2015, 2

    01/03/2015, 4

    01/04/2015, 1

    01/05/2015, 6

    01/06/2015, 3

    01/07/2015, 6

    01/08/2015, 9

    01/09/2015, 11

    01/10/2015, 6

    01/11/2015, 7

    01/12/2015, 9

];

MonthNum_Sort:

LOAD * INLINE [

    MonthNum, MonthNum2

    1, 1

    2, 2

    3, 3

    4, 4

    5, 5

    6, 6

    7, 7

    8, 8

    9, 9

    10, 10

    11, 11

    12, 12

];

Here in the above data the Monthnum_Sort is taken but it also can be done at front end in the bar chart ,Dimension Sorting.

Output:

BarChartMOnth.PNG

PFA,

HTH,

-Hirish

HirisH
“Aspire to Inspire before we Expire!”
Not applicable
Author


Many thanks.  I'll try it out and let you know..

Not applicable
Author

Thank you for your reply, I have "Hire Date" as field showing dd/mm/yy.  The records that I am currently working on is approximately about 12,000.

I want to have the year as YYYY and the month as MMM to show in the right order.  The year should not repeat based on records.

I've tried the load as per your comments but it gives me an error.

Would you please show me a step by step process.

Regards


Not applicable
Author

Thanks Enrique