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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Change month number to name NOT in SQL but in list box

I have an inherited SQL script that works fine to give me a field "Month", which contains 1-12. Naturally, on reports, I'd prefer to show the month name. First, I tried doing it SQL, but the result was the month names (fine), but in a random order. No matter what I picked in the "Sort" property in the list box, they wouldn't come up in month order (alphabetical? sure. state? sure. but calendar order? No.)  Within the "Month" (number) list box, I tried the expression = Pick(Month, $(MonthNames)) but that didn't change it. Is there away to do this in the Listbox and not in SQL?

1 Solution

Accepted Solutions
yvesqlik
Partner - Contributor III
Partner - Contributor III

bevoryou load your data from sql, you have to create a dual

load dual(String,Num) as Month inline

[String,Num

Jan,1

Fev,2

Mar,3

Apr,4

Mai,5

.

.

.

.

Dec,12

];

here you can load you data and use the fied Month.

und now you can use the name of month in your listbox.

Let me know if my solution help can help u.

best regards

View solution in original post

2 Replies
yvesqlik
Partner - Contributor III
Partner - Contributor III

bevoryou load your data from sql, you have to create a dual

load dual(String,Num) as Month inline

[String,Num

Jan,1

Fev,2

Mar,3

Apr,4

Mai,5

.

.

.

.

Dec,12

];

here you can load you data and use the fied Month.

und now you can use the name of month in your listbox.

Let me know if my solution help can help u.

best regards

Not applicable
Author

Thanks, yves, that worked just fine.