Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
BrenoSater
Contributor II
Contributor II

Previous Month dont working as expected

Hi Team, I'm trying to create a line chart that returns the values of the previous month, but I'm not getting the expected results. 

I tried everything, variable, today()-1, inmonth, but no alternative is working the way I need it to

 

I need a measure that return me all months, not only the previous month

 

Any sugestions?

 

Labels (3)
1 Solution

Accepted Solutions
MatheusC
Specialist II
Specialist II

Joia, vamos em português então melhor rsrs.

Tenta usando Above() com a função Aggr()  , veja essa postagem do @hic  vai te ajudar a entender ainda mais.

https://community.qlik.com/t5/Design/The-Above-Function/ba-p/1465357

Espero que ajude.

Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button!

View solution in original post

8 Replies
MatheusC
Specialist II
Specialist II

@BrenoSater 

Maybe this way:

year(today())-1 - 2023
year(today())-2 - 2022

 Regarts, Matheus

Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button!
BrenoSater
Contributor II
Contributor II
Author

Hi, thanks for the reply! but it's not exactly that, I can't explain it exactly as I'm a bit new to qliksense too!

But basically I needed it to show the previous month month by month, and not just in one, as shown in the image, as we are in march, it only shows february, but it was supposed to show the values of february in january, and so on...

Forgive me if my translation isn't very good either, I don't speak English very well 🙂 

BrenoSater_0-1709749715943.png

 

MatheusC
Specialist II
Specialist II

@BrenoSater 
I don't know if I understand correctly, but you can use the Above function, see the qlik help documentation and try to apply it to your expression.

https://help.qlik.com/pt-BR/sense/November2023/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/Inter...


Greetings, Matheus

 

Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button!
BrenoSater
Contributor II
Contributor II
Author

Agora que vi que você fala em português ksks, enfim...

O Above me ajudou bastante! mas estou em uma situação complicada

RangeSum(Above(Count({<SITUACAO = {"Férias", "Ativo"},DATA = ,[TIPO_DEMISSÃO] = >} distinct CPF), 1, 1))

Essa é minha expressão, só que quando coloco "Ano" no gráfico, ele começa a aparecer valores incorretos

BrenoSater_0-1709751264864.png

Ou quando chega em Janeiro ele zera

 

MatheusC
Specialist II
Specialist II

Joia, vamos em português então melhor rsrs.

Tenta usando Above() com a função Aggr()  , veja essa postagem do @hic  vai te ajudar a entender ainda mais.

https://community.qlik.com/t5/Design/The-Above-Function/ba-p/1465357

Espero que ajude.

Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button!
BrenoSater
Contributor II
Contributor II
Author

Olá! Estou muito perto da resolução final!

BrenoSater_0-1709758039451.png

Só que Janeiro-2024 não está vindo valores...

Mas de resto já ajudou demaissss!!

 

MatheusC
Specialist II
Specialist II

@BrenoSater 
Referente ao valor zerado ou nulo, acredito estar sendo o comportamento esperado da função Above, ou seja, para solucionar tente trabalhar criando uma condição com IF. Se o valor  for zero ou nulo então ele te retorne o valor do ano anterior, tente dessa forma.

 

Abraço

Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button!
BrenoSater
Contributor II
Contributor II
Author

Amigo, muito obrigado ^^

Consegui aqui, funcionou perfeitamente, estava a mais de meses tentando isso ksksks

Valeuuus