Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Condition for expression

Hi dev people, I´m new to QlikView and I have some problems with expressions.

What I am trying is to create a pivot table with 2 dimensions and 2 expressions.I want to show only one expression depending on a flag file(Flag_ist), so I am using the conditional feature for expressions.

1° Problem,

My flag field is correct, but if I can not use it properly in the Condition for the expression because it returns -1 when the value is true (When it is false, returns 0, so OK). I have checked also my flag field with an if statement and it stills return -1.

2° Problem

I change the condition expression.


//This is not working... I get always sum(sales)
Condition

     if(Flag_ist=0,0,1)
Expression
      sum(sales)

//This works

Condition
      Anything
Expression 

     if(Flag_ist=0,0,sum(Sales))

The values I get from the if are correct, sometimes 0 and sometimes 1. The problem now is that the final expression is always used. I can not hide the expression if I use the condition field.

I can use the second way, but if qlikview has a special field for the condition I would like to use it.

Thank you very much,,

Angel

1 Reply
Not applicable
Author

in dimension only take those field on which you perform some calculation, and in expression you write the condition on the basis of dimension.