Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
reporting_neu
Creator III
Creator III

"Or Condition" in Sum / Set Analysis

How can I insert an or condition?

SUM({<S_Artikel.ypA_Flag_DER -= {1}, S_Artikel.SNRArt = {190,200,205} OR S_Artikel.xc_ArtikelTyp = {'Geräte'}>ypA_RBT_Posting.Amount)

Like:
if(([S_Artikel.xc_ArtikelTyp] = 'Geräte' and [S_Artikel.ypA_Flag_DER] <> 1) or match([S_Artikel.SNRArt], 190, 200, 205), Value, null())

 

Labels (1)
2 Solutions

Accepted Solutions
Gabbar
Specialist
Specialist

So condition A if permanent, and then either one of B or C also need to happen then,

try this:
Sum({<ConditionA={A},ConditionB={B}>+<ConditionA={A},ConditionC={C}>}Amount)


Just saw your expression:-
That expression will work upto the point where one of the condition B or C are met, when both will get satisfied and then also you need output your expression wont work.

View solution in original post

reporting_neu
Creator III
Creator III
Author

I can try too:

SUM({<ConditionA = {A}, ConditionB = {B}, ConditionC -= {C}> + <ConditionA = {A}, ConditionB -= {B}, ConditionC = {C}>}Amount)

It is important that condition B and condition C are each excluded (-=) so that the values ​​are not included twice. But it definitely works that way.

View solution in original post

5 Replies
Gabbar
Specialist
Specialist

Not able to understand the question properly as Field names and order in you both logic is little bit confusing  to me.

Let me try
Suppose your Requirement is that either Condition A or Condition B needs to satisfied in set analysis for Sum,
then try this:
Sum({ < Condition A > + < Condition B > }Amount)

reporting_neu
Creator III
Creator III
Author

Hello, thank you for your answer. Your guess is correct.

I'm trying to simplify it:

Condition A must be met. Additionally condition B OR C.

SUM({<ConditionA = {A}, ConditionB = {B} OR ConditionC = {C}>}Amount)

But how can I use an OR condition?

1.) SUM({<ConditionA = {A}, ConditionB = {B} + ConditionC = {C}>}Amount) - doesn't work

2.) SUM({<ConditionA = {A}, ConditionB = {B}, ConditionC = {C}>}Amount)  - is an AND-Condition

3.) SUM({<ConditionA = {A}, ConditionB = {B} OR ConditionC = {C}>}Amount) - doesn't work

I don't know 😞 

reporting_neu
Creator III
Creator III
Author

Oh man I have the solution. I probably just thought too much...

SUM({<ConditionA = {A}, ConditionB = {B}, ConditionC -= {C}>}Amount) 
+
SUM({<ConditionA = {A}, ConditionB -= {B}, ConditionC = {C}>}Amount) 

Gabbar
Specialist
Specialist

So condition A if permanent, and then either one of B or C also need to happen then,

try this:
Sum({<ConditionA={A},ConditionB={B}>+<ConditionA={A},ConditionC={C}>}Amount)


Just saw your expression:-
That expression will work upto the point where one of the condition B or C are met, when both will get satisfied and then also you need output your expression wont work.

reporting_neu
Creator III
Creator III
Author

I can try too:

SUM({<ConditionA = {A}, ConditionB = {B}, ConditionC -= {C}> + <ConditionA = {A}, ConditionB -= {B}, ConditionC = {C}>}Amount)

It is important that condition B and condition C are each excluded (-=) so that the values ​​are not included twice. But it definitely works that way.