Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Week 52 in Jan


Dear All,

I have a cyclic group year/month/day in a chart and with the current calendar setting 1 Jan 2017 falls into week 52. My issue is when filtering data for Jan it shows week 52 as well. How can I just show week 52 in Dec 20166 and not in Jan2017 please?

month.png

Thanks

Neda

1 Solution

Accepted Solutions
adamdavi3s
Master
Master

Hi Neda,

Just apply a similar logic when you generate your master calendar

So something like

=if(month(OrderDate)=1 and week(OrderDate)=52,0, 1) as weekcheckflag


However you'll still need to alter your expressions:


sum({<weekcheckflag={'1'}>} value)


Or select the flag as a default.



Just as a random aside, can I suggest keeping all expressions in variables and then the definitions of those variables in a file, this way it makes life a lot easier when you need to make this sort of change



View solution in original post

10 Replies
sasikanth
Master
Master

HI,

because Month field Might be calculated based on date field and when you select Month 'JAN' all dates should be selected  related to JAN month.(including Jan 1st fell in 52 nd week)

if you select Year(2017) then it will show only 5 weeks

Try to suppress Zero values in Properties-->Presentation . also suppress null values in dimension.

Not applicable
Author

Hi Sasi,

Thanks for your reply. I do have values for 1st jan since supress zero wouldn't work. is there anyway when selecting weekly view week 52 wouldn't appear in Jan data?

sasikanth
Master
Master

hi,

select both MONTH and YEAR so that only 2017 related weeks will be displayed .

adamdavi3s
Master
Master

Master calendar and flags will be the simplest way to do this I imagine

adamdavi3s
Master
Master

The simplest way with a straight up formula is something like:

=if(month(OrderDate)=1 and week(OrderDate)=52,0, sum(HoursWorked))

Regular formula:

Capture.PNG

if formula:

Capture2.PNG

nitin_01
Creator
Creator

Hope this works out for you

Redefining the Week Numbers

Regards,

Nitin.

Not applicable
Author

Hi Adam,

Thanks for this. I do have Master calendar in my dashboard but not sure how to get this fixed in master calendar?

the above solution would work but I'd have to change many expressions(50!) this way so prefer to fix it in master calendar if possible.

Thanks

Neda

Not applicable
Author

Thanks Nitin, I am happy with week numbers as it is but just need to not showing week 52 in Jan chart.

sasikanth
Master
Master

Would you be able to share your app?