Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
pascos88
Creator II
Creator II

is possible return 2 expression in one if condition?

I need to return 2 expression in one if condition.

i.e   

     if(vVariable = 'Yes', Only(A) and Only(B), if(vVariable='No', Only(C) and Only(D)))

A and B or C and D will be show like a bar in the same chart.

Thanks for replay

Pasquale

23 Replies
pascos88
Creator II
Creator II
Author

thanks for the reply. but can't works for me because it show in the legend all expression even if is not used in a chart. I thought about this but I need a find another way ..

Really thanks

pascos88
Creator II
Creator II
Author

Hi Max,

Yes I want concatenate two expression.

I tried this but doesn't work. the chart show me just one expression, that is a strange number (I don't know which kind of operation the tool do). I would like to show separate bar one for A and another for B.

tresesco
MVP
MVP

Try like:

If (myVariable=1, RangeSum(Only(A), Sum(B)), if(myVariable=2, RangeSum(Only(C), Only (D)), Sum(E)))

pascos88
Creator II
Creator II
Author

Hi ,

thanks for help me, but dosn' t work yet.

imm3.png

this is the result, I have just one bar (I would like separare bar), where the value is a strange number.

What u thinking about? Maybe  you know a different way to do this?

Really thanks

morganaaron
Specialist
Specialist

If you want two bars, you'll need two expressions. If they are interchangeable, just have one be Only(A) or Only(C) and the other be Only(B) or Only(D) - that way you'll have two bars, either A and B or C and D.

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Something like this? I only made it with two buttons. The others follow a similar logic, but you didn't specify what should be displayed when clicking for example 'Opex'.

Switch Expressions Fig1thread193059.jpg

Switch Expressions Fig2 thread193059.jpg

pascos88
Creator II
Creator II
Author

Hi Peter,

but you used two different chart or just one? Regarding Opex I have other data but if I can do it for MWh and Revenue, I will do the same for other botton.

Peter_Cammaert
Partner - Champion III
Partner - Champion III

No, this is one chart that dynamically changes almost everything when you press a different button at the top.

Indeed, the addition with other amounts will follow the same logic.

If you're not using a PE Desktop, you can use the document in attachment to figure out how these screenshots were made.

Best,

Peter

pascos88
Creator II
Creator II
Author

It is just what I need. But I can't see the attach document. where is it?

MarcoWedel

don't open this reply in your inbox but open the thread itself.

regards

Marco