Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a column REPORT_DATE, to get the week wise i have loaded below in script
Ceil(Day([REPORT_DATE])/7) as Week1,
This giving me 05 weeks in the month ,wherever days are more than 28.
I want only 04 weeks & last 03 days (29,30,31) to be added in week 4 only
how to do that??
Thanks,
Ashraf
You can try to hard code the week 5 to week 4, something like
if(Ceil(Day([REPORT_DATE])/7)=5,4,Ceil(Day([REPORT_DATE])/7)) as week1
Not working, i want only 04 weeks in my data, like below
Week1: 1-7
Week2: 8-14
Week3: 15-21
Week4: 22-28 & 29/30 or 31 (if any)
can you post the sample app
Hi @ashraf_qlik ,
Try like below:
Start
if((floor(day([REPORT_DATE])/7) * 7) - 6 < 0, 1,(floor(day([REPORT_DATE])/7) * 7) - 6) as startWeek
End
if(ceil(day([REPORT_DATE])/7)>4,(floor(day([REPORT_DATE])/7) * 7) + fmod(day([REPORT_DATE]),7),if(floor(day([REPORT_DATE])/7) * 7 = 0,7,floor(day([REPORT_DATE])/7) * 7)) as endWeek
I hope helps you.