Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Ribeiro
Specialist
Specialist

Jan 2017 vs dez 2016 - Como fazer a data selecionada funcionar.

Bom estava precisando. Ao selecionar o mês jan 2017.

O filtro também trouxesse dez 2016.

Abaixo como está  o nº 1 e o nº 2.

Alguma dica?

1 -Sum({$<[GRUPOF]={'PLANEJADOS CLASSICA'} >}VLR_ITEMF)

2 - Sum({$<Mês={$(=Month(AddMonths(Max(CalendarDate),-1)))},

[GRUPOF]={'PLANEJADOS CLASSICA'} >}VLR_ITEMF)

A segunda imagem está fazendo correto. Mas quando a seleção é do mesmo ano.

2017-01-11_15-45-051.jpg

2017-01-11_15-44-44.jpg

Neves
1 Solution

Accepted Solutions
mario_sergio_ti
Partner - Specialist
Partner - Specialist

Eu trabalho com Qlik Sense, não abre layout de Qlikview;

Tente:

Sum({$<Ano={$(=Year(AddMonths(Max(CalendarDate),-1)))},

          Mês={$(=Month(AddMonths(Max(CalendarDate),-1)))}

     [GRUPOF]={'PLANEJADOS CLASSICA'} >}VLR_ITEMF)

Consultor certificado | Quem compartilha, aprende!
https://www.linkedin.com/in/mariosergioti

View solution in original post

16 Replies
Clever_Anjos
Employee
Employee

você está com o campo Ano selecionado, precisa anular no set analysis

Sum({$<Ano=,Mês={$(=Month(AddMonths(Max(CalendarDate),-1)))},

[GRUPOF]={'PLANEJADOS CLASSICA'} >}VLR_ITEMF)

Ribeiro
Specialist
Specialist
Author

Clever veja na figura 2 o valor de dezembro é 253.098.35 este seria o valor correto aparecer dez/2016

Está faltando algo.

2017-01-11_16-01-41.jpg

Neves
Clever_Anjos
Employee
Employee

Month(AddMonths(Max(CalendarDate),-1)))


Retorna o que se colocado em um Campo Texto?

Ribeiro
Specialist
Specialist
Author

Sum({$<Mês={$(=Month(AddMonths(Max(CalendarDate),-1)))},[GRUPOF]={'PLANEJADOS CLASSICA'} >}VLR_ITEMF)

Eu já uso. Mas ele só não funciona quando o ano é jan/2017 para dez/2016 O resto funciona certinho. Pensei que tinha algo. que poderia usar.

Neves
mario_sergio_ti
Partner - Specialist
Partner - Specialist

Tente

Sum({$<Ano={$(=MonthName(AddMonths(Max(CalendarDate),-1)))},

          Mês={$(=MonthName(AddMonths(Max(CalendarDate),-1)))},

          [GRUPOF]={'PLANEJADOS CLASSICA'} >}

     VLR_ITEMF)

Consultor certificado | Quem compartilha, aprende!
https://www.linkedin.com/in/mariosergioti
vinieme12
Champion III
Champion III

I don't think it'll ever work

Because YEar = 2017 and Month = 12 ?? for which you don't have Data yet

Don't use Month and YEar separately use YearMonth field for calculations like this

create a YearMonth field in your data table to simplify the calculations

example: 201601,201602 and so on

and vYearMonth = NUM(Year&NUM(Month,'00'));

and vPriorMonth= Date(Addmonths( Date($(vStartYearMonth),'YYYYMM'),-1),'YYYYMM')

You expression should then be

SUM ( {< YearMonth = {"$(vPriorMonth)"} ,[GRUPOF]={'PLANEJADOS CLASSICA'} >}VLR_ITEMF)

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

This table is a qvd. It has how to do inside qvd?

Neves
mario_sergio_ti
Partner - Specialist
Partner - Specialist

Ou melhor;

Sum({$<Ano={$(=MonthName(Max(CalendarDate),-1))},

          Mês={$(=MonthName(Max(CalendarDate),-1))},

          [GRUPOF]={'PLANEJADOS CLASSICA'} >}

     VLR_ITEMF)

A função MonthName() aceita deslocamento

Consultor certificado | Quem compartilha, aprende!
https://www.linkedin.com/in/mariosergioti
vinieme12
Champion III
Champion III

Create the YearMonth Month field during LOAD

LOAD

NUM(Year(Date)&NUM(MONTH(Date),'00')) as YearMonth,

Field1

Field2.....

From yourQVD;

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