Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
qliksus
Specialist II
Specialist II

Confusing output as per putting a if condition in the expression

Please find the attached file. My requirement is to show Two value based upon selection. That's why i created a inline field and try to get the output. But unfortunately Chart2 give me only one month output where is should show all month as per the Chart1.

can anyone tell why this is giving odd type output?

1 Solution

Accepted Solutions
lironbaram
Partner - Master III
Partner - Master III

hei ok

changed the expression back to the original order

added  a set analysis for the if part

have a look

i put the expression sum(Sale) for style 'XYZ'

which shows the currentt selection amount

View solution in original post

6 Replies
lironbaram
Partner - Master III
Partner - Master III

hei

i changed your expression and write the if inside the sum

usualy when using set analysis put the if inside other wise you need to set analysis the if argument also

qliksus
Specialist II
Specialist II
Author

Hi,

Thanks for the reply. The inline field contain 2 value i:e abc, xyz.

And i want show 2 different expression based on 2 selection. Means For abc , one expression will work and for xyz,

different will work.

How can i acheive this?

lironbaram
Partner - Master III
Partner - Master III

hei ok

changed the expression back to the original order

added  a set analysis for the if part

have a look

i put the expression sum(Sale) for style 'XYZ'

which shows the currentt selection amount

qliksus
Specialist II
Specialist II
Author

Thanks for the solution.

Please do one favour ,

Can u explain why u have given all selection parametre outside also??

lironbaram
Partner - Master III
Partner - Master III

hei

well if you use set analysis you create diffrent selection state then the current selection

as inner formulas are contauned in the selection state of the outer formulas

if you wont put set analysis in the outer formulas , the state of selection for all inner formulas

will be the current selection, this logic is suppresing the inner set anlysis

hope it helps you

qliksus
Specialist II
Specialist II
Author

Hi,

This works fine if there is some value for current selection. If there is no value for a current selection but still u want see sum of previous month value then it fails. Please open my latest attached file Date1.qvw, there you can see Chart 1 gives me output where Chart2 and Chart3 is not giving output.

Can you help me to solve this type of issue?