Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
LP27
Creator II
Creator II

Issue with week function on QS

Hi,

I am actually facing issue with week function in Qlik Sense.

I have written expression as below- 

if( Week(today()) >  Week(([Calendar day])),'Week' &' '&Week(([Calendar day])) &'('& Year(([Calendar day]))&')')

This should show me all weeks which is lesser than today, but it is just showing something like this.

Week 1(2020)Week 1 (2019)Week 1(2018)

 

Note : Field [Calendar day] is a Date format in MM/DD/YYYY.

This was fine until Dec-2019 but now its is  just showing Week 1 of 2020, 2019, 2018 ( as shown in table above)

Not sure how to proceed further.

Any help will be Appreciated ! 

Thanks

 

Labels (4)
1 Solution

Accepted Solutions
Kashyap_R
Partner - Specialist
Partner - Specialist

Hi

Try this

if(today() >  ([Calendar day]),'Week' &' '&Week(([Calendar day])) &'('& Year(([Calendar day]))&')')

Thanks

 

Thanks and Regards
Kashyap.R

View solution in original post

4 Replies
Kashyap_R
Partner - Specialist
Partner - Specialist

Hi

Try this

if(today() >  ([Calendar day]),'Week' &' '&Week(([Calendar day])) &'('& Year(([Calendar day]))&')')

Thanks

 

Thanks and Regards
Kashyap.R
LP27
Creator II
Creator II
Author

Thanks for the expression.

That works fine! 

But I am not able to sort the row in descending order like shown  below -

Week 2 (2020)Week 1 (2020)

Week 53 (2019)

Week 52 (2019)Week 51 (2019)Week 50 (2019)Week 49 (2019)Week 48 (2019)Week 47 (2019)Week 46 (2019)

 

All the columns are randomly sorts now, But I want to sort according to the table shown above.

I know that we need to changed in Sorting section but I tried by numeric and alphabets but was not successful. 

Kashyap_R
Partner - Specialist
Partner - Specialist

Hi

Try this and sort numerically

if(today() >  ([Calendar day]),dual('Week' &' '&Week(([Calendar day])) &'('& Year(([Calendar day]))&')',year([Calendar day])&num(Week(([Calendar day])),'00')))

Hope this helps 

Thanks

 

Thanks and Regards
Kashyap.R
LP27
Creator II
Creator II
Author

Yes this is perfect.

Thanks Kashyap 🙂