Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
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?

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

What about this:

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

Kushal_Chawda

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

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

Kushal_Chawda

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

Is it possible to share a sample?

Kushal_Chawda

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.