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: 
Thiago_Justen_

Saldo Atual - Estoque

Boa tarde comunidade,

Estou com uma questão que não estou conseguindo resolver. Deve ser algo simples mas confesso que travei nisso.

Eis a questão: Preciso apresentar o estoque atual de itens para (exemplificando) os dados abaixo:

Capturar.PNG

O que preciso então: Pegar o saldo por produto na data da última movimentação. Neste caso deveria ter -

ABRAÇADEIRA COM ALÇA 3.1/2 INOX... = 6 UN

ABRAÇADEIRA DA TURBINA MB 1935... = 3 UN

AMORTECEDOR CABINE 1935................ = 2 UN

TOTAL.......................................................... = 11 UN

Eis meu modelo de dados:

Capturar.PNG

A dimensão [Movimentacao - Saldo] é criada no script da seguinte maneira:

Rangesum(If( ID_Material = Previous(ID_Material),

      Rangesum( [Movimentacao - Quantidade], Peek([Movimentacao - Saldo]) ) 

        , [Movimentacao - Quantidade]))                                                                           AS [Movimentacao - Saldo]



Preciso de uma solução para um KPI que mostrará a quantidade total de itens em estoque para posterior valoração.


Agradeço desde já a ajuda de vocês!


Abs e Sucesso!

Thiago Justen Teixeira Gonçalves
Farol BI
WhatsApp: 24 98152-1675
Skype: justen.thiago
Labels (3)
1 Solution

Accepted Solutions
sunny_talwar

May be like this

Sum(Aggr(If([Movimentacao - Data] = Max(TOTAL <[Material - Descricao]> [Movimentacao - Data]), [Movimentacao - Quantidade]), [Material - Descricao], [Movimentacao - Data]))

View solution in original post

9 Replies
Thiago_Justen_
Author

Any suggestion stalwar1‌?

Thiago Justen Teixeira Gonçalves
Farol BI
WhatsApp: 24 98152-1675
Skype: justen.thiago
sunny_talwar

Are you looking to get the sum by the most recent date for each Material-Description?

Thiago_Justen_
Author

Yeah Sunny.

Thiago Justen Teixeira Gonçalves
Farol BI
WhatsApp: 24 98152-1675
Skype: justen.thiago
sunny_talwar

May be like this

Sum(Aggr(If([Movimentacao - Data] = Max(TOTAL <[Material - Descricao]> [Movimentacao - Data]), [Movimentacao - Quantidade]), [Material - Descricao], [Movimentacao - Data]))

Thiago_Justen_
Author

Sunny, that's exactly what I wanted. Actually, I made a simple modification:

Sum(Aggr(If([Movimentacao - Data] = Max(TOTAL <[Material - Descricao]> [Movimentacao - Data]), [Movimentacao - Saldo]), [Material - Descricao], [Movimentacao - Data]))



But man...It's awesome!!!

Could you please, recommend me any lecture or guide (advanced) to help me handle this situation?


Cheers

Thiago Justen Teixeira Gonçalves
Farol BI
WhatsApp: 24 98152-1675
Skype: justen.thiago
sunny_talwar

The best way to learn is by helping other solve there problems. I would say continue to help others and you will learn a lot quicker

Thiago_Justen_
Author

I'm doing this, man, really! 

And, obviously, you and the others MVP's are helping me much more than I would expected.

Cheers

Thiago Justen Teixeira Gonçalves
Farol BI
WhatsApp: 24 98152-1675
Skype: justen.thiago
sunny_talwar

Yup, I do see your responses... continue doing this and you will learn much quicker.

Thiago_Justen_
Author

Thanks a lot man!

Thiago Justen Teixeira Gonçalves
Farol BI
WhatsApp: 24 98152-1675
Skype: justen.thiago