Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
ecolomer
Master II
Master II

Different results with Set Analysis

I have the same formula Set Analysis in two tables and get different results and can not find the cause.

Can you see the image

P_Valores.png

Attached is a simple data

1 Solution

Accepted Solutions
Gysbert_Wassenaar

You're using a calculated dimension in the bottom pivot table and you've enabled Suppress When Value is Null for it. That's causing the difference.


talk is cheap, supply exceeds demand

View solution in original post

8 Replies
antoniotiman
Master III
Master III

Hi Enrique,

in Your Set Expression You have

.......... <=$(=Date(FecFin, 'DD/MM/YYYY'))"

FecFin  ->  3/11/2016

In First chart there are no limits of Fecha

in the second chart there are limit to 31/10/2016 in dimension

=if([Fecha Operación] >= vFecIni and [Fecha Operación] <= dayend(vFecFin), [Fecha Operación])

So , If You change FecFin to vFecFin You get same results.

Regards,

Antonio

ecolomer
Master II
Master II
Author

Yes, but I need appear only movements between vFecIni and vFecFin

maxgro
MVP
MVP

maybe a missing v?

Sum([Saldo neto]) - Sum({$<[Fecha Operación]={">=$(=Date(vFecIni, 'DD/MM/YYYY')) <=$(=Date(vFecFin, 'DD/MM/YYYY'))"}>} Importe)

ecolomer
Master II
Master II
Author

Hi maxgro

No, is correct FecFin.

I've two variables:

- vFecIni is the first date for the interval

- vFecFin is the final date for the interval

- FecFin is the max date in table. In this date I have "Posición" or "Saldo Neto" for this Cuenta.

Posición Inicial = Saldo Neto - Sum(Importe ... from vFecIni to FecFin (both included)

Posición Final = Saldo Neto - Sum((Importe ... from vFecFin (not included) to FecFin (included) or  greater than vFecFin

Gysbert_Wassenaar

You're using a calculated dimension in the bottom pivot table and you've enabled Suppress When Value is Null for it. That's causing the difference.


talk is cheap, supply exceeds demand
ecolomer
Master II
Master II
Author

I Changed calculed dimension, and include selection in expressions.

[Entradas] = if([Fecha Operación]>=vFecIni and [Fecha Operación]<= vFecFin, sum(if(Importe > 0, Importe, 0)))

[Salidas] = if([Fecha Operación]>=vFecIni and [Fecha Operación]<= vFecFin, sum(if(Importe < 0, Importe, 0)))

And results correct.

Thank's for alls

Gysbert_Wassenaar

sum(if(Importe > 0, Importe, 0))

You don't need to use an if statement here. Try this instead: sum(RangeMax(0, Importe)). And for the other expression RangeMin instead of RangeMax.


talk is cheap, supply exceeds demand
ecolomer
Master II
Master II
Author

Yes you're right