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

How to delete negative weeks in calendar

Hi all

How to delete Negative Weeks "-51,-50,-49,-48,....." like in Calendar

Calendar.png

7 Replies
MK_QSL
MVP
MVP

Question is How you get these negative weeks? May be your logic is wrong somewhere in script !

alexandros17
Partner - Champion III
Partner - Champion III

You can add a simple condition in your listbox, something like:

If(week < 0, Null(), week)

but the question is: why do you have negative weeks?

Take a look to your data ...

datanibbler
Champion
Champion

Hi madhu,

that is a very interesting scenario - how did you calculate negative weeks to begin with?

Knowing how you did that might help us advise you as to how to get rid of them.

HTH

Kushal_Chawda

How you are calculating week?

madhubabum
Creator
Creator
Author

if(Year(tmp_Date)=WeekYear(tmp_Date), Week(tmp_Date) - Week(MonthStart(tmp_Date)) + 1,  Week(tmp_Date) + 52 - Week(MonthStart(tmp_Date)) + 1) AS [Week in Month], 

madhubabum
Creator
Creator
Author

if(Year(tmp_Date)=WeekYear(tmp_Date), Week(tmp_Date) - Week(MonthStart(tmp_Date)) + 1,  Week(tmp_Date) + 52 - Week(MonthStart(tmp_Date)) + 1) AS [Week in Month], 

MK_QSL
MVP
MVP

Can you explain the logic behind this calculation please?