Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Kindly advice how to sort Months in Charts to be in correct order (Jan, Feb, Mar, Apr......).
Now it is showing as ( Apr, Aug, Dec, Feb, Jan, Jul, Mar, May.....)! I have tried all options in the Sort tab but did not help.
Thank You.
You can transform in your script:
Aux:
LOAD
dual(string, numrep) as Cal_Mes INLINE [
string,numrep
jan, 1
feb, 2
mar, 3
apr, 4
mai, 5
jun, 6
jul, 7
ago, 8
sep, 9
oct,10
nov,11
dec,12
];
to have a dual field and use Iwrote last
sort by Num(Month) because is a dual variable
Not so clear Enrique !
Please explain further.
OK, I'm sorry
If you have a field "Month" with date format, this field are dual: numeric (1, 2, 3 ...) and text (Jan, Feb, ...)
If you need use them in numeric format, write Num(Month) to use numeric values
In the order you can write in Expression: Num(Month)
to have a correct management, the Month field must have date format
Hi
The only thing you need to do when you use Month as chart dimension, is to sort this dimension by Numeric Value, Ascending (on the Sort Tab), and this will sort the months the way you want.
This is because although we can see a three-character format of the month, for QlikView, months are still integers (1-12), so if you want to sort of even align these values, you'll have to treat them as numbers.
I hope this helps
Agis
Faisalaaa wrote:
I have tried all options in the Sort tab but did not help.
I suspect that your month field is a text field, not a dual Month() field. Use something like this to convert the text Month field from your data source into a dual Month field:
LOAD ....
Month(Date#(Month, 'MMM')) As Month
Then sort numerically.
Thanks Enrique /Agis,
But I havetried both ways, did not work.
My Dimension is Month as Jan, Feb, Mar. Not as dd/mm/yy.
In the sort tab, I have tried Numertic value sort AND Expression as Text(Month) and Num(Month), giving me an error !
Hi Faisalaaa,
are you able to post a sample qvw for further investigation?
Andy
You can transform in your script:
Aux:
LOAD
dual(string, numrep) as Cal_Mes INLINE [
string,numrep
jan, 1
feb, 2
mar, 3
apr, 4
mai, 5
jun, 6
jul, 7
ago, 8
sep, 9
oct,10
nov,11
dec,12
];
to have a dual field and use Iwrote last