Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
See why BI users voted Qlik #1 in 11 categories. GET REPORT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Date filter by weeks (data por semanas)

Good morning, I created an application in qlik where I can filter the data by year, month and day, I also want to be able to do the selection for weeks
Exp: Week 1, Week 2, Week 3, Week 4, and Week 5. If anyone can give help I am grateful.

Bom dia, criei uma aplicação no qlik aonde consigo filtrar os dados por ano,mês e dia, quero poder também fazer a seleção por semanas

exp: Semana 1, Semana 2, Semana 3, Semana 4, e Semana 5. Se alguém poder dar ajudar  fico grato.

1 Solution

Accepted Solutions
Highlighted
Not applicable

Resolvido - Identificar a qual semana do mês determinada data pertence.

"LET vDateMin   = Num(MakeDate(year(Today())-1,1,1)); 

LET vDateMax   = Num(MakeDate(year(Today()),12,31));

TempCalendario: 

LOAD

   Date($(vDateMin) + RowNo() - 1)  AS Data

   AUTOGENERATE 1 

WHILE $(vDateMin)+IterNo()-1<= $(vDateMax); 

left join

LOAD

   Data,

   1+ceil((Data-floor(weekend(monthstart(Data),0,-1)))/7) as [Semana do Mês],

   WeekDay(Data)                                          as [Dia da Semana],

   Week(Data)                                             as [Semana do Ano]

Resident TempCalendario; "

View solution in original post

3 Replies
Highlighted
Not applicable

Tenho o mesmo problema.

A diferença é que quero montar uma tabela com os resultados separados por semana 1, semana 2, semana 3, etc...

Highlighted
Champion II
Champion II

Highlighted
Not applicable

Resolvido - Identificar a qual semana do mês determinada data pertence.

"LET vDateMin   = Num(MakeDate(year(Today())-1,1,1)); 

LET vDateMax   = Num(MakeDate(year(Today()),12,31));

TempCalendario: 

LOAD

   Date($(vDateMin) + RowNo() - 1)  AS Data

   AUTOGENERATE 1 

WHILE $(vDateMin)+IterNo()-1<= $(vDateMax); 

left join

LOAD

   Data,

   1+ceil((Data-floor(weekend(monthstart(Data),0,-1)))/7) as [Semana do Mês],

   WeekDay(Data)                                          as [Dia da Semana],

   Week(Data)                                             as [Semana do Ano]

Resident TempCalendario; "

View solution in original post