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: 
pedromsouza
Creator
Creator

Ajuda com set analysis

Como buscar o último mês?

A expressão que tenho é esta:

Sum({<Identificador={'xyz'}>} valor)

O campo que o usuário irá selecionar é:

ano_mes_atendido

que retorna valores da seguinte forma:

2017-05

2017-06...

Qliking since '09
Labels (1)
1 Solution

Accepted Solutions
Clever_Anjos
Employee
Employee

Se for string, use MaxString()

View solution in original post

8 Replies
Anil_Babu_Samineni

May be this?

Sum ({<Identifier = {'xyz'}, ano_mes_atendido = {'$(=Max(ano_mes_atendido-1))'}>} value)

OR

Sum ({<Identifier = {'xyz'}, ano_mes_atendido = {'$(=AddMonths(Max(ano_mes_atendido),-1))'}>} value)


Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Anonymous
Not applicable

Eai Pedro, beleza?

Se for o que eu entendi, você quer a soma do Valor do Ultimo mês que os seus dados possuem, certo?

pedromsouza
Creator
Creator
Author

It didn't work. Ano_mes_atendido isn't a date field. It has a string in the following format: yyyy-mm. Like 2017-10,2017-11 and so on...

Qliking since '09
Anonymous
Not applicable

Tente colocar no seu Script:

     Date(Date#([Ano_mes_atendido],'YYYY-MM'),'MM/YYYY') as Data_Atendimento

E fazer da forma que o Anil te passou,

Clever_Anjos
Employee
Employee

Se for string, use MaxString()

pedromsouza
Creator
Creator
Author

Não funcionou.

Tentei

=Sum ({<Identificador = {'xyz'}, ano_mes_atendido = {'$(=maxstring(ano_mes_atendido))'}

,ano=,mes=>} valor)

Qliking since '09
Clever_Anjos
Employee
Employee

Se possivel anexe seu modelo de dados

Como obter ajuda? Leia antes de postar

pedromsouza
Creator
Creator
Author

Me perdoem. Na verdade funcionou com Maxstring, eu só tinha que colocar para ignorar outros campos de data. Muito obrigado!

Qliking since '09