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: 
cristian_av
Creator III
Creator III

PivotTable with multiple conditions

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?

QV1.pngQV2.png

1 Solution

Accepted Solutions
cristian_av
Creator III
Creator III
Author

Finally I solved with this:

if(RowNo()>0 AND IsNull(Mes),

  Sum(VolumenReal/1000)

,

  Sum({<Mes=>}VolumenReal)/1000

)

View solution in original post

2 Replies
m_woolf
Master II
Master II

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.

cristian_av
Creator III
Creator III
Author

Finally I solved with this:

if(RowNo()>0 AND IsNull(Mes),

  Sum(VolumenReal/1000)

,

  Sum({<Mes=>}VolumenReal)/1000

)