14 Replies Latest reply: Oct 30, 2017 2:17 AM by Pooja Goswami

2 conditions within 1 expression

Dear users,

I came across a challenge. I would like to add another condition to this expression.

I want to use OR operator for these two conditions.

Expression:

sum({<Quarters=GetFieldSelections(Quarters}  ,  [Accounting Period=GetFieldSelections([Accounting Period]),  [Service Rev])

Kindly help.

• Re: 2 conditions within 1 expression

Try to use p().

• Re: 2 conditions within 1 expression

Since I am using Qliksense, I am unable to find p() & e() in it.

• Re: 2 conditions within 1 expression

What is the purpose of this set expression? Selecting values in the two fields will already be reflected in the expression results anyway.

• Re: 2 conditions within 1 expression

I have just noticed the OR requirement...

Sum({<Quarters = P(Quarters)> + <[Accounting Period] = P([Accounting Period])>} [Service Rev])

• Re: 2 conditions within 1 expression

P() and E() work just fine in QS.

• Re: 2 conditions within 1 expression

What is the use of P() while using '+' sign ?

• Re: 2 conditions within 1 expression

What is the use of P() while using '+' sign ?

+ is a logical Or of the two sets

P() gets possible values for a field

• Re: 2 conditions within 1 expression

Is it important to P() while using +.?

• Re: 2 conditions within 1 expression

>> Is it important to P() while using +.?

They are two different things, as explained in an earlier post.

• Re: 2 conditions within 1 expression

I want to use  [Accounting Period] -3   value..

Sum({<Quarters = P(Quarters)> + <[Accounting Period] = (P([Accounting Period])-3)>} [Service Rev])

Did not get correct answer by using above expression.

How to use get subtracted value ?

• Re: 2 conditions within 1 expression

I want to use  [Accounting Period] -3   value..

How do you want to use it? Do you mean you want to select records from 3 months/periods ago?

This is a different question to your original post. I suggest you start a new thread with this question. Remember that the quality of the responses will be proportional to the amount of information you provide. Sample documents (qvw/qvf) usually help.

• Re: 2 conditions within 1 expression

Hi,

This is not a different question.

I need to use this expression (  [Accounting Period] -3  ) inside P(), but not getting the results.
Kindly help.
• Re: 2 conditions within 1 expression

Well the '-3' part was never part of your original question. P returns possible values for a field, not an expression. How exactly do you want to select [Accounting Period]? Subtracting 3 days from what?

• Re: 2 conditions within 1 expression

I need to get previous third value from accounting period, that's why [Accounting_Period] -3. How do I do this using P()??