Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm using a calculated dimension to Know the number of week in the month.
=if(month(weekend(Fecha))= month(Fecha),Round(div(day(WeekEnd(Fecha)),7)),Round(div(day(Weekend(Fecha,-1)),7))+1)+1
It's works well except the months who start on Monday.
Example: 01/09/2014 returns week 2. (7/7 = 1 +1) = 2
I think that a possibbility it's weekday(MonthStart(Fecha)) = 'lun' (monday) then don't sum 1 but i can't solve it on the sequence.
Any idea to solve it?
Thanks!
JAG
Hola Jordi,
Podrías probar con Ceil((Day(Fecha)+WeekDay(MonthStart(Fecha)))/7)
Jordi tal vez no entiendo muy bien la pregunta pero yo las saco asi:
'Semana'&Ceil(Day(Fecha)/7) as SemanaDelMes
Try like below:
if(month(weekend(Fecha))= month(Fecha),div(day(WeekEnd(Fecha)),7),div(day(Weekend(Fecha,-1)),7)+1)+1 as WeekNumber,
or check below:
http://community.qlik.com/blogs/qlikviewdesignblog/2014/01/27/week-numbers
Thanks,
Singh
Hi Alfredo,
My weeks are from Monday to Sunday
Thanks for the answer but your exemple don't works because for example 30/06/2014 (in your sequence is week number 5) and for me this day is week number 6).
Thanks
Un ejemplo
Hi,
Don't works. Thanks for the link
Regards
you can change the forst day of the week in the system variables in exactly this one:
from this:
SET DayNames='Lun;Mar;Mie;Jue;Vie;Sab;Dom';
to this:
SET DayNames='Dom;Lun;Mar;Mie;Jue;Vie;Sab';
Hola Enrique,
Gracias por el ejemplo pero no veo por ningún lado que me indique el número de semana dentro del mes.
Subo un ejemplo:
Saludos,
Hola Jordi,
Podrías probar con Ceil((Day(Fecha)+WeekDay(MonthStart(Fecha)))/7)
Hola Jordi,
Si, vuelve a bajar el fichero y en la última pestaña lo tienes