Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
cliff_clayman
Creator II
Creator II

Set analysis expression issue

Hello,

I am trying to use the following in an expression to populate a field in a chart and it is not returning a value:

=IF([TEH] = 'A',SUM({$<[Month] = {'M1'}>} [TotalEmpl]))

This part does return the value when used outside of the chart

=SUM({$<[Month] = {'M1'}>} [TotalEmpl])

What am I doing wrong?

Labels (1)
1 Solution

Accepted Solutions
cliff_clayman
Creator II
Creator II
Author

$(=sum({$<[Period] = {'P2'}>} [HC]))
This produces the correct value.

View solution in original post

8 Replies
sunny_talwar
MVP
MVP

What about this:

=Sum({$<[Month] = {'M1'}, TEH = {'A'}>} [TotalEmpl])

Kushal_Chawda
MVP
MVP

try this if you want to display the result for [TEH]= A

SUM({$<[Month] = {'M1'}, [TEH]={'A'}>} [TotalEmpl])

Kushal_Chawda
MVP
MVP

If it's not working please provide more details

which chart?

what are dimesion?

what are expression?

Anonymous
Not applicable

If you selects A from [TEH], probably your will get the value of your expression..

Best part is always use SET Analysis, Sunny Thave already suggested you same

cliff_clayman
Creator II
Creator II
Author

=Sum({$<[Month] = {'M1'}, TEH = {'A'}>} [TotalEmpl])


This still returns a value of 0.  When I apply this to a simple textbox outside of the chart, I get the correct value.  I'm not sure what is wrong.  What other information can I provide that will help?  I am very new to all of this.

sunny_talwar
MVP
MVP

Is it possible to share a sample?

Kushal_Chawda
MVP
MVP

I think Your period is not associated with MCR heading. See the screenshot.

When I am selecting any MCR Heading. Period is blank

Capture.JPG

Also I checked your data model which involves many synthetic keys. Try to optimize your data model.

cliff_clayman
Creator II
Creator II
Author

$(=sum({$<[Period] = {'P2'}>} [HC]))
This produces the correct value.