Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
thiago_alessand
Contributor III
Contributor III

Greater than in set analysis

Hello,

 

How can I use greater than signals with 2 date fields, in set analysis?

 

I tried, but not working:

COUNT({<DataAtendimentoChamadoAtrasadoTI = {">DataPrazoChamadoAtrasadoTI"}>}NumChamadoAtrasadoTI)
Labels (2)
11 Replies
elvis_schwarz
Creator
Creator

Tenta da seguinte forma:

COUNT({<DataAtendimentoChamadoAtrasadoTI = 
{">=$(=Min(DataPrazoChamadoAtrasadoTI))<=$(=Max(DataPrazoChamadoAtrasadoTI))"}>}NumChamadoAtrasadoTI)
pradosh_thakur
Master II
Master II

try the below

if(DataAtendimentoChamadoAtrasadoTI  > DataPrazoChamadoAtrasadoTI , COUNT(NumChamadoAtrasadoTI)
)

I hope you are using it in a table or simillar

Learning never stops.
pradosh_thakur
Master II
Master II

If you could tell us something about it, it would be easier to help as the expression may vary according to that.

Learning never stops.
thiago_alessand
Contributor III
Contributor III
Author

Obrigado pelo retorno. Trouxe apenas valor 0.

 

thiago_alessand
Contributor III
Contributor III
Author

Thank you for your help.

But, isn't working. I'm using in normal table.

 

The results was for all columns: "-"

 

 

pradosh_thakur
Master II
Master II

Can you add some sample data and the output you are expecting.
Learning never stops.
thiago_alessand
Contributor III
Contributor III
Author

The results are just 0 or -.

 

The expected results are 2,1,3,2,9....

 

Both fields come from database and are in format YYYY-MM-DD (Sample:  14/02/2019)

pradosh_thakur
Master II
Master II

Well.. I am not seeing any data so this won't make much sense to me. If you can add a few lines of input data and the output , it would be easier.
Learning never stops.
thiago_alessand
Contributor III
Contributor III
Author

There may be something stange in this code, but is because I already tried sometimes without success.

 

 

ChamadosAtrasadosTI:
Load
	num_chamado,
    data_abertura,
	categoria,
//    prazo,
    MAKEDATE(YEAR(prazo),MONTH(prazo),DAY(prazo)) AS prazo,
    hora_prazo,
    data_conclusao,
    //data_atendido,
    MAKEDATE(YEAR(data_atendido),MONTH(data_atendido),DAY(data_atendido)) AS data_atendido,
    //dataAtendimento,
    MAKEDATE(YEAR(dataAtendimento),MONTH(dataAtendimento),DAY(dataAtendimento)) AS dataAtendimento,
    horaAtendimento,
    prioridade,
    autor_chamado,
    status,
    dataPrazo;
    

SQL SELECT c.num_chamado, c.data_abertura, c.categoria, (SELECT STR_TO_DATE(prazo, '%d/%m/%Y') FROM complemento WHERE num_chamado = c.num_chamado and prazo is not null 
ORDER BY id_complemento DESC LIMIT 1) AS prazo, (SELECT hora_prazo FROM complemento WHERE num_chamado = c.num_chamado and hora_prazo is not null
ORDER BY id_complemento DESC LIMIT 1) AS hora_prazo, c.data_conclusao,c.data_atendido, DATE(data_atendido) AS dataAtendimento, TIME(data_atendido) AS horaAtendimento,
c.prioridade, c.autor_chamado, c.status, CAST(CONCAT(prazo, ' ', hora_prazo) AS datetime) AS dataPrazo
FROM chamado AS c 
WHERE //DATE(data_atendido) > prazo OR  ( DATE(data_atendido) = prazo and TIME(data_atendido) > hora_prazo)
YEAR(data_abertura) = $(vrAno);