Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hI
I have a complicated pivot table. It uses a lot of expressions from three tables, so it's getting me a headache..
In this table, I have a field called "Mes"(Month in Spanish), but I also have a selector for the same field.
I need to sum a value only for the selected months. For this, I'm using an expression like this:
if(isNull(Mes)),
Sum(VolumenReal/1000)
,
Sum({<Mes=>}VolumenReal)/1000
)
The trouble with this, is that if I select more than one moth, the "total" line ignores the month.
I've tryied with this other condition:
if(Not(GetSelectedCount(Mes)>1 OR Not(IsNull(Mes))),
...
which works as expected, except that it ignores the non-selected months, and show me values for all months (like second image)
Can anybody help me please?
Finally I solved with this:
if(RowNo()>0 AND IsNull(Mes),
Sum(VolumenReal/1000)
,
Sum({<Mes=>}VolumenReal)/1000
)
if(isNull(Mes)),
Sum(VolumenReal/1000)
,
Sum({<Mes=>}VolumenReal)/1000
)
The set analysis (in red) is telling QV to ignore selections in the Mes field. Just remove that from the expression.
Finally I solved with this:
if(RowNo()>0 AND IsNull(Mes),
Sum(VolumenReal/1000)
,
Sum({<Mes=>}VolumenReal)/1000
)