Skip to main content
Announcements
Join us on Sept. 17 to hear how our new GenAI Assistant empowers data professionals: REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
vandrecarlos
Contributor III
Contributor III

Error on a Formula - Totalization on Set Analysis

Hello, guys!

I'm facing an error to totalize a measure on Qlik Sense.

 

The measure is the one below:

 

//VALOR RECEBIDO
=
IF(([Ano Documento Vendas - (VBAK-ERDAT)]<=[Ano Documento Faturamento - (VBRK-FKDAT)]
OR [Mês Documento Vendas - (VBAK-ERDAT)]<=[Mês Documento Faturamento - (VBRK-FKDAT)]),

SUM({<[OV Tipo - (VBAK-AUART)]={'Ordem de Venda Unifort'},
[Recusa OV - (VBAP-ABGRU)]-={'87', '88', '89'},
[Tipo de condição - (KONV11-KSCHL)]={'ZEVI'}>}
[Montante da Condição - (KONV11-KWERT)])

,'0')

 

Basicaly I want grab the value of docs who has been billed and show the original value of the reception of the doc.

For example:

I have a doc with the value of R$1.000,00 and we billed only R$500,00, so I want to show the value of R$1.000,00

if this doc hasnt been billed, It has to show R$0,00. 

 

Doing that my x-table show me the correct values in the cells, but I cant receive a total for that measure.

Is that something wrong there?

 

Thank you guys for the help!

Labels (5)
3 Replies
Channa
Specialist III
Specialist III

try to replace this by using [Recusa OV - (VBAP-ABGRU)]=sum{*} - [Recusa OV - (VBAP-ABGRU)]={'87', '88', '89'}

Channa
vandrecarlos
Contributor III
Contributor III
Author


@Channa wrote:

try to replace this by using [Recusa OV - (VBAP-ABGRU)]=sum{*} - [Recusa OV - (VBAP-ABGRU)]={'87', '88', '89'}


 

Channa, thank you for you reply!

 

I tried your line and it didn't worked.

 

Here's the srceenshot. Am I doing it right?

mod.png

vandrecarlos
Contributor III
Contributor III
Author

Guys, 

 

I was doing some research and found out that the function AGGR() can solve my problem, but with AGGR() on it I still can't totalize!

 

Here's my mod formula

 

//VALOR RECEBIDO

(
IF((
[Data de criação do Documento de Vendas - (VBAK-ERDAT)] <= [Data doc.faturamento p/índice de docs.faturamto.e impressão - (VBRK-FKDAT)]),

SUM(AGGR(SUM({<[OV Tipo - (VBAK-AUART)]={'Ordem de Venda Unifort'},
[Recusa OV - (VBAP-ABGRU)]-={'87', '88', '89'},
[Tipo de condição - (KONV11-KSCHL)]={'ZEVI'}>}
[Montante da Condição - (KONV11-KWERT)]), [Categoria Material - (AUSP)], [Ordem de Vendas - (VBAP-VBELN)],[Nº do material - (VBAP-MATNR)]))

,'0')
)

 

Someone please can help me?