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

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Month Order in listbox

Hi,

Is there anyway to have jan as the first month in the list box...similarly Monday as the first day in the day list box?

i cant do that using the options given the sorting section.

Your help on this would be appreciated.

3 Replies
Not applicable
Author

Hi, I believe that your month and day fields are text and not dates. So I made two new list boxes based on your dates. See the attached file.

maxgro
MVP
MVP

you could add an expression to the sort tab of your listbox (Day) to order the Day listbox

=match(Day, 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday')

but I suggest to make a Calendar (llok for Master Calendar in community, an example here How to create a Calendar) in the script: you can then add and order your listbox using Text and/or "Numeric Value" without always typing the previous (or similar) expression  

Anonymous
Not applicable
Author

Hello!

Although creating a master calendar is the best approach, you can solve your problem using QlikView date functions which return dual values and sort the list boxes in numerical order. Your code would look like this:

SET MonthNames='January;February;March;April;May;June;July;August;September;October;November;December';

SET DayNames='Monday;Tuesday;Wednesday;Thursday;Friday;Saturday;Sunday';

Attendence_Clear:

Load

  Date,

  WeekDay(Date) as Day,

  Weekno,

  Month(Date) as Month,

  Quarterno,

  Year,

  Intime,

  Outtime,

  Totalhrs;

SQL SELECT * FROM AUDWSQLLAB.dbo."Attendence_Clear";

Notice that I have changed the variables MonthNames and DayNames since you seem to want full names for months and week days, not abbreviated ones.

Attached is a QVW working as expected.

Cheers.