Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to order by in a chart by a date in text format?

Hi,

Someone could help me?

1- i dont know how to order that chart ascending by month - Year

Consulta 1.PNG

I have this dimension in the chart: =IF( YEAR(fecVale)=vMaximoAño,month(fecVale)&'-'&year(fecVale)) that show me only the last year.

2- The same with the next chart where i have the dimension: =IF( YEAR(fecContab)=vMaximoAño,day(fecContab)&' '&Month(fecContab)).

i Want to order by daymonth ascending.

Captura 2.PNG

Many thanks, i am starting with qlik.

1 Solution

Accepted Solutions
sunny_talwar

May be use this as your dimension

1)

=If(Year(fecVale) = vMaximoAño, Date(MonthStart(fecVale), 'MMM-YYYY'))

2)

=If(Year(fecContab) = vMaximoAño, Date(SetDateYear(fecContab, Year(Today())), 'DD MMM'))

View solution in original post

7 Replies
sunny_talwar

May be use this as your dimension

1)

=If(Year(fecVale) = vMaximoAño, Date(MonthStart(fecVale), 'MMM-YYYY'))

2)

=If(Year(fecContab) = vMaximoAño, Date(SetDateYear(fecContab, Year(Today())), 'DD MMM'))

Anonymous
Not applicable
Author

First of all, many thanks for the prompt response.

1-Excelent!! it works great.

2- In this case, the order works  as well!! but i want to display the 20 new ones.

Something like that but with the last ones.(The last 20 dates )

Captura.PNG

Captura.PNG

sunny_talwar

Not sure I understand.... would you be able to share a sample to check it out?

Anonymous
Not applicable
Author

Ok, i will try to explain it again. My english is not so good. Captura 2.PNG

This pic show the last 11 diferent values of date (the newest ones), cause i limited the expression to the last 11 values.In this case it shows (23,22,21,20,16,15,14,13,12,9,8).

But when i use your calculated dimension it changes the values of the dimension. Now i see:

Captura.PNG

What i want is the first picture but ordered like that--> 8,9,12,13,14,15,16,20,21,22,23.

Did i explain myself?  Sorry

Many thanks again

Anonymous
Not applicable
Author

i am trying to do something like that but it does not work.

print.png

vUltimos30Dias=Date(AddMonths(Date(Date#(vMaximaFecha,'YYYY-MM-DD'),'YYYY/MM/DD'),-1),'YYYY-MM-DD')

i am trying to limit the dimension to the last 30 dates.

sunny_talwar

I would recommend to use set analysis to restrict your dates, but to show how it can be done I would need a sample. There is not straight forward answer I can give you here without a sample or sample data at least

Anonymous
Not applicable
Author

Many thanks, i resolved it.