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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Weekly Calculation


Hi All

I would like to create a list box that shows weekly ranges for the selected Month starting from monday to sunday in a calendar day number format e.g  "1-7 Week1", "8-14 Week2"...etc How can I do this?

Labels (1)
1 Solution

Accepted Solutions
its_anandrjs
Champion III
Champion III

Hi,

Try to write expression in any list box like

=Day(WeekStart(DateField))&'-'&Day(WeekEnd(DateField))&' Week'&Week(DateField)

Or You can create any field in the load script

Load

Day(WeekStart(DateField))&'-'&Day(WeekEnd(DateField))&' Week'&Week(DateField) as WeekAndDayStend,

From Source;


Regards

Anand

View solution in original post

7 Replies
its_anandrjs
Champion III
Champion III

Hi,

Try to write expression in any list box like

=Day(WeekStart(DateField))&'-'&Day(WeekEnd(DateField))&' Week'&Week(DateField)

Or You can create any field in the load script

Load

Day(WeekStart(DateField))&'-'&Day(WeekEnd(DateField))&' Week'&Week(DateField) as WeekAndDayStend,

From Source;


Regards

Anand

Not applicable
Author

Hi

Thanks for your reply. I wrote the line of code as you suggested

Day(WeekStart("RE_DAY"))&'-'&Day(WeekEnd("RE_DAY"))&'Week'&Week as WeekAndDay

I get an error "Field not found - <Week>

SQL SELECT *

FROM SORCE"

its_anandrjs
Champion III
Champion III

For this write

Day(WeekStart("RE_DAY"))&'-'&Day(WeekEnd("RE_DAY"))&' Week '&Week("RE_DAY") as WeekAndDay

Regards

Anand

Not applicable
Author

Thanks! It works. Now what do I do if I want this in a chonological order? e.g week1- week52

saurabh5
Creator II
Creator II

can u post the code how u derived week...or the script, to know what is causing the error?

its_anandrjs
Champion III
Champion III

Then in the list box properties >> Sort >> Sort By >> Select State (Auto Ascending) and Select Load Order (Original)

Not applicable
Author


Hi Anand

Never mind...i managed to figure it out. thanks a lot again for your solution

@Saurabh I'm good now thanks