Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
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
Not applicable
Author

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
Not applicable
Author

Tenho o mesmo problema.

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

vinieme12
Champion III
Champion III

Period Presets: Compare Periods on the fly

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Not applicable
Author

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; "