7 Replies Latest reply: May 5, 2012 8:35 AM by swuehl RSS

Creating a graph where you can choose different years... (noob)

Erik Hultgren



Im totally new to qlikview, i have tried to look at some videos and stuff but i have som questions now and im hopefull that someone here can help me out.


Im having a excel file, with jan-dec and every month have a value say between "0-500" and then i have this information for 2 years. I have managed to create a barchart for each year, but i really want a graph just showing the "months" on the x-axis and the values on the y-axis. Then i want a listbox where i can choose between 2012 and 2013.


But when i try to create a graph i only get dots and not the line between the dots, and also i don't know how to do to change between years.


I hope this makes sence, it's quite hard to explain and english is not my native language.


Thanks for all help!!

  • Re: Creating a graph where you can choose different years... (noob)



    I assume you do have a flat table with fields


    Year, Month, Value

    2011, Jan, 123


    2012, Jan, 231





    It might be best to create a date field from Year and Month and to convert your Month string field to a dual value field (this makes it much easier to sort your Month in chronological order later on).


    So maybe use two additional lines in your load like:


    LOAD Year,RAND()*500 as Value,

    date(date#(Year&Month, 'YYYYMMM')) as MonthStart,

    month(date#(Year&Month, 'YYYYMMM')) as Month

    INLINE [

    Month, Year

    Jan, 2011

    Feb, 2011

    Mar, 2011

    Apr, 2011

    May, 2011

    Jun, 2011

    Jul, 2011

    Aug, 2011

    Sep, 2011

    Oct, 2011

    Nov, 2011

    Dec, 2011

    Jan, 2012

    Feb, 2012

    Mar, 2012

    Apr, 2012

    May, 2012

    Jun, 2012

    Jul, 2012

    Aug, 2012

    Sep, 2012

    Oct, 2012

    Nov, 2012

    Dec, 2012



    Starting from this flat table, it should be easy to create a line chart, use Month as dimension, =sum(Value) as expression (since Month can hold multiple values for multiple years, you need to use an aggregation function here), and create a list box to choose a year (you can force always one selected value in list box properties).


    Please see attached,