Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Contracted Table

Hy, I have a table:

Month    Day     Value

1            1           12

1            2           23

1            3           15

1            4           20

1            5           30

When I Contracted the field day the values are add, for example:

Month       Value

1     +        100

All the values are add.

When I contracted the table, I want to pick the last value only, for example:

Month    Value

1            30

Can you help me??

Thanks a lot.

1 Solution

Accepted Solutions
Clever_Anjos
Employee
Employee

Veja se atende

=if(Dimensionality()=4,sum(SALDOFISFINAL),sum({<DIA={"$(=MAX(DIA))"}>}SALDOFISFINAL))

View solution in original post

12 Replies
Clever_Anjos
Employee
Employee

Are you using a pivot table, I guess

Whats your expression for "Value"?

Maybe

FIRSTSORTEDVALUE(

       AGGR(

           SUM(Value),

        Month, Day

      ),

      -(Month*100+Day)

)

could return what you want

Anonymous
Not applicable
Author

It doesn't work.

Clever_Anjos
Employee
Employee

Would you mind sharing your app?

Anonymous
Not applicable
Author

I Can't, but my original table is:

    

DepósitoDiaSaldo Físico
ESTOQUE FILIAL ARAUCARIA1846.660,0
ESTOQUE FILIAL ARAUCARIA21.770.338,0
ESTOQUE FILIAL ARAUCARIA31.747.598,0
ESTOQUE FILIAL ARAUCARIA41.747.598,0
ESTOQUE FILIAL ARAUCARIA51.710.088,0
ESTOQUE FILIAL ARAUCARIA61.740.136,0

When I contract the table I want to see only the last Saldo Físico (1.740.136,0).

   

DepósitoSaldo Físico
ESTOQUE FILIAL ARAUCARIA1.740.136,0

And then when I expand again will appear the original table.

Can you help me??

Anonymous
Not applicable
Author

Dimensions = Depósito, Dia

Expression = sum(Saldo Físico)

Clever_Anjos
Employee
Employee

FIRSTSORTEDVALUE(

       AGGR(

           sum(Saldo Físico),

        Depósito, Dia

      ),

      -(Dia)

)

retorna o que?

Anonymous
Not applicable
Author

Expandido retorna:

    

DepósitoDiaSaldo Físico
ESTOQUE FILIAL ARAUCARIA15.844.106,0
ESTOQUE FILIAL ARAUCARIA210.957.426,0
ESTOQUE FILIAL ARAUCARIA310.132.676,0
ESTOQUE FILIAL ARAUCARIA410.132.676,0
ESTOQUE FILIAL ARAUCARIA59.861.746,0
ESTOQUE FILIAL ARAUCARIA610.081.976,0

Contraído:

   

DepósitoSaldo Físico
ESTOQUE FILIAL ARAUCARIA10.081.976,0

Quando está contraído está trazendo o valor correto, ultima linha, porém está calculando errado o valor quando está expandido.

Clever_Anjos
Employee
Employee

Teria como postar uma amostra da aplicação? Ou então enviar para clever@clever.com.br

Anonymous
Not applicable
Author

Enviado por email