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

Problem with Sum and Set Analisys

I have a table with many rows

Format Data = DD/MM/YYYY

Fields:     Data                <>      Pontos Possiveis      <>      Pontos Conquistados

Rows:     01/01/2016                20                                        10    

               01/02/2016                20                                        20     

I have this expression


Sum({<Mês=,Ano=,Data={"=$(vDataPesquisaRED)"}>} [Pontos Conquistados)

/

Sum({<Mês=,Ano=,Data={"=$(vDataPesquisaRED)"}>} [Pontos Possiveis])

The variable vDataPesquisaRED return the Max Date

The result would be 1, because (20 / 20)

But my results is 0,75, because (30 / 40)

I don't know why the Qlik return 0,75, the correct is 1

Can someone help me?


Kind regards

Labels (1)
5 Replies
sunny_talwar

Can you try this without the variable:

Sum({<Mês=,Ano=,Data={"$(=Date(Max(Data)))"}>} [Pontos Conquistados)

/

Sum({<Mês=,Ano=,Data={"$(=Date(Max(Data)))"}>} [Pontos Possiveis])

maxgro
MVP
MVP

1.png


the expression


Sum({<Mês=,Ano=,Data={"$(vDataPesquisaRED)"}>} [Pontos Conquistados])

/

Sum({<Mês=,Ano=,Data={"$(vDataPesquisaRED)"}>} [Pontos Possiveis])

and the variable


=Date(Max(Data))

ronald_gdi
Contributor III
Contributor III
Author

This option doesnt' work too.

If I put AGGR command into a Aggregate Dimension:

Aggr(Sum({<Mês=,Ano=,Data={"$(=Date(Max(Data)))"}>} [Pontos Conquistados)

        /

        Sum({<Mês=,Ano=,Data={"$(=Date(Max(Data)))"}>} [Pontos Possiveis),Data)

This code returns a table containing the calculated data by date. And I need to catch the last month , I need to add another code. I do not know.

I have a example with real data

ScreenHunter_02 Mar. 08 22.45.gif

ronald_gdi
Contributor III
Contributor III
Author

This option doesnt' work too.

If I put AGGR command into a Aggregate Dimension:

Aggr(Sum({<Mês=,Ano=,Data={"$(=Date(Max(Data)))"}>} [Pontos Conquistados)

        /

        Sum({<Mês=,Ano=,Data={"$(=Date(Max(Data)))"}>} [Pontos Possiveis),Data)

This code returns a table containing the calculated data by date. And I need to catch the last month , I need to add another code. I do not know.

I have a example with real data

ScreenHunter_02 Mar. 08 22.45.gif

Clever_Anjos
Employee
Employee

Já achou uma solução? Se alguma resposta foi a correta, marque como "Correta" para fechar o tópico e nos ajudar a manter o forum organizado.

Como obter ajuda? Leia antes de postar