Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
musketeers
Creator
Creator

need hint in ranking the month names

Hi,

I have a calendar table in qlikview which consist of date, month, quarter, year values.

In qlikview dashboard I need to display month names in multi box.

The requirement is like:

> If the current month is June, then I need to display month names like: June, May, Apr, March, Feb, Jan............till July month of previous year.

So, I need to display all 12 months which consist of month names between current month and January month of current year and from December of the previous year to (current month plus one) month of previous year.

Please help if any logic is there or please provide any hint in this.

Thanks

3 Replies
Anonymous
Not applicable

Hi Ranjeesh,

Try with data format as  'MMM-DD-YYYY'.

R/Murali.

jonathandienst
Partner - Champion III
Partner - Champion III

Create your own dual month value with values to suit your sort order:

Let vBase = Num(Month(Today()));

Join(Calendar)

LOAD CalDate,

  Dual(Text(Month(CalDate)),

  If(Month(CalDate) < $(vBase),

  Month(CalDate) + $(vBase) + 1, 

  Month(CalDate) - $(vBase) + 1 )) as SortedMonth

Resident Calendar;

So June will have a value of 1, July 2, etc - sort the field numerically. And this will dynamically adjust when the month is July, August etc to keep the current month at the top of the heap.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
musketeers
Creator
Creator
Author

Ji Jonathan,

This has helped me a lot and was able to resolve my problem with this.

Sorry for late reply.