Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
As can be seen in the image above I can filter my variable `vDefects_Production` by the dimension `Conformed Cause Code` to arrive at the values shown; 9k, 3k, etc.
To instead filter using Qlik Sense set analysis I created this code that is a measure in my expression editor:
Sum({$<[Conformed Cause Code]={'Vendor'}>} vDefects_Production)
The issue is that this code spits out values of `0` for all the categories above (Toothbrush, Monitors, etc.) that previously had values of 9k, 3k, etc.
I imagine there's something wrong with my Qlik syntax? Or is there some other problem with my code?
OK
Here is another suggestion.
Make an adjustment to your variable vDefects_Production so it looks like this.
sum({$<[Conformed Cause Code] = {$1},[# QN Initiated]={1},[Conformed Location Code]={'Production'}>}[Complaint Quantity])
When calculating the sum for Conformed Cause Code = Vendor then use this expression
=$(vDefects_Production(Vendor))
What is the content of your vDefects_Production variable? Is it a field name or an expression?
If the variable vDefects_Production is an aggregating expression such as SUM(DefectProducts) then you can try something like this.
=sum( {<[Conformed Cause Code] = {'Vendor'}>} aggr($(='$(=vDefects_Production)'), [Conformed Cause Code] ))
The definition of the variable is:
sum({$<[# QN Initiated]={1},[Conformed Location Code]={'Production'}>}[Complaint Quantity])
I did attempt to use your other solution but got the same results, everything was `0`. Thank you for the attempt. Any other ideas?
OK
Here is another suggestion.
Make an adjustment to your variable vDefects_Production so it looks like this.
sum({$<[Conformed Cause Code] = {$1},[# QN Initiated]={1},[Conformed Location Code]={'Production'}>}[Complaint Quantity])
When calculating the sum for Conformed Cause Code = Vendor then use this expression
=$(vDefects_Production(Vendor))
Instead of messing around with variables I just am going to use this entire expression as my solution:
sum({$<[# QN Initiated]={1},[Conformed Location Code]={'Production'},[Conformed Cause Code]={'Vendor'}>}[Complaint Quantity])
I'd try out your solution but don't have the permission level in Qlik Sense Cloud to create/edit variables. I'll assume you're correct though and "accept as solution". Thank you.