Qlik Community

Qlik DataMarket Discussions

Discussion Board for collaboration regarding Qlik DataMarket.

pooja821
New Contributor III

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.

14 Replies
shraddha_g
Honored Contributor III

Re: 2 conditions within 1 expression

Try to use p().

MVP
MVP

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.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
MVP
MVP

Re: 2 conditions within 1 expression

I have just noticed the OR requirement...

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

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
pooja821
New Contributor III

Re: 2 conditions within 1 expression

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

MVP
MVP

Re: 2 conditions within 1 expression

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

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
pooja821
New Contributor III

Re: 2 conditions within 1 expression

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

pooja821
New Contributor III

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 ?

MVP
MVP

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

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
MVP
MVP

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.


Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Community Browser