Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Show Current Date, then 12 Months

Hello,

  I'm looking to create a graph that show the current date as the first entry in the graph, then goes out 12 months. So for february it would look like below.

CurrentDate, 3,4,5,6,7,8,9,10,11,12,1,2....up to current date.

Is this possible?

16 Replies
Not applicable
Author

In the sorting tab, on your dimension sort by expression

if(MYear < Month(Today()), MYear+12, MYear)

Not applicable
Author

This is what I have so far. But it does not change the order of the data in ascending order, when I change it to descending it gets all funky.

If([As of Date]<date(Today()), ([As of Date]+365),[As of Date])

And my dimension is this to allow Y to Year comparison.

date(makedate(1+(month("As of Date")>7),month("As of Date"),day("As of Date")),'MM/DD')

Not applicable
Author

I think I didnt get the point.

my idea was for month only.

Can you upload what you have so far?

Not applicable
Author

A small sample. The data set is too large to have all the months in it.

Anonymous
Not applicable
Author

what if you were to add an extra line to your load script .

Grab the Year and Month to make a sequential number ie: Feb 2011 is 201102, 201103, 201104 - for March , April and so on.

When you get to Jan 2012 its an even higher number, 201201.

give this field a name ie: MonthYearSort and set a variable on this then use Set Analysis where the value is >= to your variable.

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try this expression

=Sum({<Year=, Month=, CurrentDate={'$(=Today())'} + {'>=$(=MonthStart(Today(), 1))<=$(=MonthEnd(Max(CurrentDate), 12))'}>} Sales)

Hope this helps you.

Regards,

Jagan.

Not applicable
Author

As the sort? Or as the actually expression?

Not applicable
Author

Okay, that makes sense. How would I make the variable equal to today? I can't use the same autonumber function can I ?

Not applicable
Author

For today yearmonth:

Year(Today()) & num(Month(Today())), '00')