Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anil_Babu_Samineni

Week Number Count

Hello Friends,

I do have one Date Field. In that, i want to show the week number in Text object.

I written, Count(Week(DateField))

Is that expression is correct?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
1 Solution

Accepted Solutions
Anil_Babu_Samineni
Author

Helpful

I am expecting some thing like this

Count(Distinct WeekNumber)

Here, Week number is Num(Week(DateField)) -- Script Level

Got it Thank you

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

11 Replies
MindaugasBacius
Partner - Specialist III
Partner - Specialist III

Simple use week(DateField).

To get the week number in the TextObject you need to select only single Date.

MindaugasBacius
Partner - Specialist III
Partner - Specialist III

Also suggest you reading this blog post:

Redefining the Week Numbers

Anil_Babu_Samineni
Author

Thanks Sir,

If i have 2005 to 2016 and then it showing 12 * 52 == Value

If i am using this it will working

=Count(distinct week(DateField))

Thanks

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
MindaugasBacius
Partner - Specialist III
Partner - Specialist III

In this case you need the total number of weeks between two dates, am I correct?

MindaugasBacius
Partner - Specialist III
Partner - Specialist III

= (max(DateField) - min(DateField)) / 7

This formula allows you to get the exact number of weeks between two dates.

Anil_Babu_Samineni
Author

Ok, This scenario i have only one Date field. How to get that. Is my expression is correct?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
MindaugasBacius
Partner - Specialist III
Partner - Specialist III

Use this one:

= (max(DateField) - min(DateField)) / 7 

Instead of DateField use your Date field.

Anil_Babu_Samineni
Author

So, i want to show the weeks which is

If i want to show the report that time i want to show upto last week with the key of Starting Date to Reporting date - 1

Something like that. This scenario how do we use that

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
dineshraj
Partner - Creator
Partner - Creator

Hi Mindaugas Bacius,

I need make 19/4/2007 this week as first week of the year.

How to get it?