

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mode function not working
Hi,
I need to calculate the MODE of the result of the following expression:
if(MaxString(_CodTipoSeleccion) = 'EF',
((Sum({<_KeyFecha={'>=$(v_FechaInicioSK)<=$(v_FechaFinSK)'},Año,Fecha,Día,DiaMes,Semana,Mes,MesNum,nMes,Trimestre, FchDocumentoVenta= >}MargenBruto) - Sum({<_KeyFecha={'>=$(v_FechaInicioSK)<=$(v_FechaFinSK)'},Año,Fecha,Día,DiaMes,Semana,Mes,MesNum,nMes,Trimestre, FchDocumentoVenta= >}ImpGastos)) / (Sum({<_KeyFecha={'>=$(v_FechaInicioSK)<=$(v_FechaFinSK)'},Año,Fecha,Día,DiaMes,Semana,Mes,MesNum,nMes,Trimestre, FchDocumentoVenta= >}ImporteVenta)- Sum({<_KeyFecha={'>=$(v_FechaInicioSK)<=$(v_FechaFinSK)'},Año,Fecha,Día,DiaMes,Semana,Mes,MesNum,nMes,Trimestre, FchDocumentoVenta= >}ImpGastos)))
,
((Sum(MargenBruto)- sum(ImpGastos)) / (Sum(ImporteVenta)-sum(ImpGastos)))
)
I wrapped all that into a variable that I've used in the Mode function but I keep getting nulls.
I'm using it in a straight table with three dimensions.
Any idea?
Thank you
- « Previous Replies
-
- 1
- 2
- Next Replies »
Accepted Solutions


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Jfkinspari, no equal included.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No I don't


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The expression works well with and without the variable in the table.
The problem arises when I apply an aggregation function to it. I am not sure I to backtrack that from there...


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have now reduced the expression to this:
Mode(Sum(MargenBruto))
and it's still returning null values


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That works!!
Thank you so much for your help. It's really appreciated!

- « Previous Replies
-
- 1
- 2
- Next Replies »