Skip to main content
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

1 Solution

Accepted Solutions
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

View solution in original post

23 Replies
Not applicable

could u share any sample data

Mark_Little
Luminary
Luminary

Hi,


What exactly you trying to do?

You can turn any amount of expression conditionally, but depends what you mean if this would apply or not.

Mark

pascos88
Creator II
Creator II
Author

Maybe I can't because I have just trial Version. I try to be more clarify.

I have 5 expression A B C D E.

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

The format of expression look good, but dosn't work

I would to have this solution and use just one bar chart. The dimension is always the same.

I don't know, maybe there is another solution to show 2 expression with a define condition.

nagarjuna_kotha
Partner - Specialist II
Partner - Specialist II

Could you share sample data ?

And also explain little bit more.

pascos88
Creator II
Creator II
Author

I want use one bar char that change the expression inside when change the variable selected.

Immagine2.png

I have this two chart and the variable that I use are the boton up (Mwh, Revenue, Opex etc)

I would like have  just the first chart, that change dynamically the expression inside.

If MWh is selected my expression will be Production and P50 Product; if I select the variable Revenue, my expression should change in Revenue and Revenue BGT.

I need to insert some condition in expression that return me two condition.

I hope that is more easy to understand in this way

tresesco
MVP
MVP

If condition is true, you have x and y. Do you want them to be added ?

pascos88
Creator II
Creator II
Author

Yes, where x e y are 2 Expression

Not applicable

Hi Pasquale,

Exactly i don't no ,but may be helpful for you

sample:

load * inline [

dim,A,B,C,D,E

a,1,2,3,4,5

b,9,8,7,5,6

];

When click a in dim

Untitled.png

when click b in dim

Untitled.png

PrashantSangle

Hi,

If you want to conacatenate output of two expression

then try like

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

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂