Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

X-Axe Year&'-'&Month

Hey!

With the new year a problem appeared in my Qlikview! I have a Chart with Year&Month as X-Dimension. As Year I only have 2012 and 2013. As Month I have: Jan, Feb, Mrz ... Dez.

I would like to have an ordered X-Axe:  2012-Jan ; 2012-Feb .... 2012-Dez ; 2013-Jan

How can I do this??

Thank you for your time and happy new year!!!!!!

Eduardo

1 Solution

Accepted Solutions
adamwilson
Partner - Creator
Partner - Creator

thats right & is a reserved character, justname it something else eg:

LOAD Datum,

  Year (Datum) as Jahr,

  Month (Datum) as Monat,

  Day (Datum) as Tag,

  Hour (Datum) as Stunde,

  Minute (Datum) as Minute,

  Date(floor(Datum),'DD/MM/YYYY') as DatumTag,

  MonthName(Datum) as MonthAndYear

View solution in original post

8 Replies
Not applicable
Author

Hi

in the sort tab

select expression and give the expression like

if u have monthnumber then give it

Not applicable
Author

Hi,

Give this expression in to sort-->Expression --> acending

match(right(YearandMonthField,3),'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec')

numeric value ----> acending

~Kabilan K

Not applicable
Author

Hey Kabilan!

Thank you for your answer! Now my X-Axe is ordered by months but for example I have 2012-Jan and 2013-Jan side by side. Qlikview don't understand "numeric value --> Ascending".

What can I do to solve this problem??

Thank you for your time!!!

Eduardo

Not applicable
Author

I tried this other expression:

 

match

(left(Jahr&Monat,4),'2012','2013','2014','2015','2016','2017','2018','2019')& match(right(Jahr&Monat

,3),'Jan','Feb','Mrz','Apr','Mai','Jun','Jul','Aug','Sep','Okt','Nov','Dez')

It almost works... but I don't know why, I get 2013-Jan between 2012-Sep and 2012-Okt... Have you any idea?

Eduardo

adamwilson
Partner - Creator
Partner - Creator

change your calendar dimension field in the script layer to:

     MonthName(DateField) as Year&Month,

it'll format like 'Jan 2013' and QlikView will recognise it as a date and you can order it numerically

Not applicable
Author

Hey Adam!

Thank you for your help but I don't understand exactly what I should do... My skript is like this:

LOAD Datum,

  Year (Datum) as Jahr,

  Month (Datum) as Monat,

  Day (Datum) as Tag,

  Hour (Datum) as Stunde,

  Minute (Datum) as Minute,

  Date(floor(Datum),'DD/MM/YYYY') as DatumTag, 

Should I write then:

MonthName(Datum) as Year&Month, ???? Qlikview don't let me work with "&"

Thank you!

Eduardo

adamwilson
Partner - Creator
Partner - Creator

thats right & is a reserved character, justname it something else eg:

LOAD Datum,

  Year (Datum) as Jahr,

  Month (Datum) as Monat,

  Day (Datum) as Tag,

  Hour (Datum) as Stunde,

  Minute (Datum) as Minute,

  Date(floor(Datum),'DD/MM/YYYY') as DatumTag,

  MonthName(Datum) as MonthAndYear

Not applicable
Author

Thank you Adam!!! Now it works!!!!!!!

Eduardo