Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Customer & Partners, DEC. 9, 11 AM ET: Qlik Product & Strategy Roadmap Session: Data Analytics REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
julesjohnson
Contributor III
Contributor III

Variable in Set Analysis

Hi,

Can anyone tell me how to fix this expression.

=Count( {$<$(ROIC)= '{">=1} >} Distinct [Part_Number])


I would like to count the number of parts where the variable ROIC" is greater than 1, for example.


Thanks,

16 Replies
jcampbell474
Creator III
Creator III

Is the variable ROIC a single value or a list?  Please hlep me understand what you're trying to do.

julesjohnson
Contributor III
Contributor III
Author

Hi Jason,

It is a calculated value derived from Profit/ Investment.

jcampbell474
Creator III
Creator III

Ok, so it's a static value?  Is it always > 0?

julesjohnson
Contributor III
Contributor III
Author

Hi Jason,

  It is calculated so no, not static. Yes, there is a possibility that it can be negative.

jcampbell474
Creator III
Creator III

Thank you.  Do you have a field associated with the variable (ROIC)?  It looks like you're using set analysis to create a data set using ROIC, but I don't see a field that can be >=1 in your expression.  In other words, the variable can be >=1, but the variable isn't linked to a field the correlates to the Part Number.  If you have the field, I might be able to help with the expression.

julesjohnson
Contributor III
Contributor III
Author

Hi Jason,

I am not sure I get what you are asking.

What I am attempting to do is say count the number of parts where the calculation for ROIC > 1.

In the following example, the number returned should be 2. 

 

Part #DescriptionROIC
z45Crank-2
x25Lever5
f85cover0
h85line1.2
jcampbell474
Creator III
Creator III

Ok, that makes more sense.  ROIC isn't a variable, it's a field. 

Try this: count({<ROIC={'>=1'}>} Distinct Part_Number)


Of course, the result will depend on what dimension you use.  Using your example, I would use Description.

julesjohnson
Contributor III
Contributor III
Author

Thanks for the suggestion but unfortunately that did not work.  ROIC is a variable so the $ expansion will need to be added.  It is also a field in a table, but I would like to create buckets for a graph where the fields in the table will not be used. 

jcampbell474
Creator III
Creator III

Sorry about that.  Will this work: count({<ROIC={">=$(ROIC)"}>} Distinct Part_Number)