Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
BARC’s The BI Survey 19 makes it official. BI users love Qlik. GET REPORT
Highlighted
Partner
Partner

change first day of week in a calendar object

Hi,

I have a calendar object in my module which shows monday as first day of week.

What can i do to change first day of week in the calendar to Sunday?

Thanks,

Raz/

14 Replies
Not applicable

Re: change first day of week in a calendar object

Hi,

the value depends of the DateFormat set in the script, but also take a look into definition of WeekStart function.

regards

raz-datamind
New Contributor

Re: change first day of week in a calendar object

Hi,

Date Format is DD/MM/YYYY.

i know the QV assumes first day of week to be monday, and if i want to have a FirstDayOfWeek field i use WeekStart(Date,0,-1),

But what i want to do now is to use Date field in a calendar object and have it start on sunday.

So i still have no idea how to achieve it.

shaik_basha
Contributor III

Re: change first day of week in a calendar object

Hi,

Please fiend the attachment of application and let me know,

  change the sorting based on numeric value asa asceinding.

Regards

Partner
Partner

Re: change first day of week in a calendar object

Hi,

What i would do is to go to script editor (ctrl+E)

Change the default setting from 

SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat,Sun';

to

SET DayNames='Sun;Mon;Tue;Wed;Thu;Fri;Sat';

Let me know if it worked

Regards,

Gabriel

raz-datamind
New Contributor

Re: change first day of week in a calendar object

Hi Shaik,

i'm not sure what you had in mind, but i don't see how it is related to my question.

But thanks for trying to help.

raz-datamind
New Contributor

Re: change first day of week in a calendar object

Hi Gabriel,

Already tried it, bur it seems that this setting is anly naming convention, and does not affect real week-day settings.

But thank you too for trying to help.

Partner
Partner

Re: change first day of week in a calendar object

Hi,

In that case try this approach.

Right click the chart and

chart > Properties > Sort > check the box beside Expression & click on Expression > click on ecclipse (...) then type 

=Match(DIMENSION NAME,'Monday','Tuesday','Wednesday','Friday','Saturday','Sunday')

Click ok & ok

Let me know if it work

Regards,

Gabriel

raz-datamind
New Contributor

Re: change first day of week in a calendar object

Hi Gabriel,

That's a nice approach and it would surely work in a table. but my object is a calendar object, and i see no change in sorting.

Thanks.

Partner
Partner

Re: change first day of week in a calendar object

Hi,

Try this in the script editor

load dual ( string,numrep ) as DayOfWeek inline

[ string,numrep

Sunday,0

Monday,1

Tuesday,2

Wednesday,3

Thursday,4

Friday,5

Saturday,6

];