Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Ribeiro
Specialist
Specialist

Average Sales in the last 30 days - Fixed Report

I need to find the Average Sales (VND) last 30 days.

I need to put set Analysis 2 in Set Analysis 1

How do I put the average of the last 30 days in a fixed report?

Any suggestion...


2017-10-29_10-32-42.png


Set Analysis: 1

sum({$<Ano ={$(=Year(today()))},Mes={$(=Month(today()))},Dia={$(=Day(today()))},[Tipo]={'OTE'} >}Qtde)

Set Analysis: 2

Avg({<Data={">=$(=Date(Max(Data) - 30, 'D/M/YYYY'))"},[Tipo]={'VND'}>}Qtde)



set analysis 1 +  set analysis 2

2017-10-29_10-53-53.png

CodigoProduto

DataTipoSequenciaQtde
128/10/2017OTE40010
128/10/2017VND4011
115/10/2017VND3993
115/06/2017VND2886
131/09/2017VND3813
103/10/2017VND4013
115/08/2017VND2852
Neves
1 Solution

Accepted Solutions
sunny_talwar

May be this

If(sum({$<Ano ={$(=Year(today()))},Mes={$(=Month(today()))},Dia={$(=Day(today()))},[Tipo]={'OTE'} >}Qtde)<> 0,

AVG(TOTAL <CodigoProduto>{$<Ano ={$(=Year(today()))},Mes={$(=Month(today()))},[Tipo]={'VND'}>}Qtde))

Capture.PNG

View solution in original post

5 Replies
sunny_talwar

May be this

If(sum({$<Ano ={$(=Year(today()))},Mes={$(=Month(today()))},Dia={$(=Day(today()))},[Tipo]={'OTE'} >}Qtde)<> 0,

AVG(TOTAL <CodigoProduto>{$<Ano ={$(=Year(today()))},Mes={$(=Month(today()))},[Tipo]={'VND'}>}Qtde))

Capture.PNG

Ribeiro
Specialist
Specialist
Author

Many thanks, perfect ....

Neves
Ribeiro
Specialist
Specialist
Author

I need to bring the stock. But he's adding up.
I think I need to handle the set analysis to handle the stock
See that the inventory table relates this to another normal and in the other it is adding ...


qvw is up 210x

Correct Stock

GG = 1

P = 3


Is Stock bringing 10?

2017-10-30_14-56-39.png

If(sum({$<Ano ={$(=Year(today()))},Mes={$(=Month(today()))},Dia={$(=Day(today()))},[CodigoFilial]={'2'},[Tipo]={'OTE'} >}Qtde)<> 0,

sum(TOTAL <CodigoProduto>{$<Data={">=$(=Date(Max(Data) - 1000, 'D/M/YYYY'))"},[CodigoFilial]={'2'}>}Estoque))

Neves
sunny_talwar

Try this

If(sum({$<Ano ={$(=Year(today()))},Mes={$(=Month(today()))},Dia={$(=Day(today()))},[CodigoFilial]={'2'},[Tipo]={'OTE'} >}Qtde)<> 0,

sum(TOTAL <CodigoProduto, NomeTamanho1>{$<Data={">=$(=Date(Max(Data) - 1000, 'D/M/YYYY'))"},[CodigoFilial]={'2'}>}Estoque))

Ribeiro
Specialist
Specialist
Author

Obrigado.

Neves