Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
OmarBenSalem
Not applicable

Sorting By Date

Hi Everyone,

Here is what I'm doing,

I've created an Inline Table :

Timeframe:

LOAD * INLINE [

    TimeframeId, Timeframe

    1, Monthly

    2, Yearly

      ];

So my graphics will vary as I select a Frame,

For example, if I select Monthly, I will see the evolution of my KPI for the last 12 months, yearly is for the last 2 years evolution.

My dimension is as so :

pick(timeframeId,

month(calendar_date)&Year(calendar_date),

year(calendar_date)

.Now, if I select Monthly, I will have this grphic( the evolution for the last 12 months):

Displaying image.png

My selected Date is 19 of October.

You can see that the sorting is wrong since October2016 should be at the end !

What I haven't understood is, when I select a date in a completely charged month, for example 20 september 2016, I will have a sorted graphic !
I've tried so many expression to counter this and still can't find a way to correct it.

Can anyone help? Thanks !

Omar,

1 Solution

Accepted Solutions
rupamjyotidas
Not applicable

Re: Sorting By Date

Oops I replied too soon. Instead of doing below in Dimension

month(calendar_date)&Year(calendar_date),

Why not in Script you do this

Date(Callendar-Date,'MMM-YYYY') as MonthYear

then you can sort is by the settings above

9 Replies
sunny_talwar
Not applicable

Re: Sorting By Date

I think you image isn't attached properly, can you reattach please?

Best,

Sunny

OmarBenSalem
Not applicable

Re: Sorting By Date

unnamed.png

rupamjyotidas
Not applicable

Re: Sorting By Date

If the Dates are in NumberFormat. Usually Sorting can be done with this setting.

filip_duchateau
Not applicable

Re: Sorting By Date

Wouldn't it be easier if you created a cyclic group for your dimension instead of defining an inline table with time frames ?

sunny_talwar
Not applicable

Re: Sorting By Date

Are you using an expression for sorting? Like a Match() function expression? I think you need to use Match(Only({1} FieldName), .....) to not allow for it to drill down based on selections.

rupamjyotidas
Not applicable

Re: Sorting By Date

Oops I replied too soon. Instead of doing below in Dimension

month(calendar_date)&Year(calendar_date),

Why not in Script you do this

Date(Callendar-Date,'MMM-YYYY') as MonthYear

then you can sort is by the settings above

OmarBenSalem
Not applicable

Re: Sorting By Date

It's the client demand; he want a dynamic dashboard in which all the graphics will change as he select a timeframe

sunny_talwar
Not applicable

Re: Sorting By Date

Or use this as your dimension:

Pick(timeframeId,

MonthName(calendar_date),

Year(calendar_date))

OmarBenSalem
Not applicable

Re: Sorting By Date

That went reaaly good !

I've created a Month-Year field in my calendar; then changed my dimension as so :

pick(timeframeID,

date(MonthYear,'MMM/YYYY'),

year(calendardate)

)

then I sorted by ascending numeric value, and that went good !