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

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
dataDrivenDecision
Contributor
Contributor

Set Analysis Filtering by the product of two fields

Hi,

I am trying to filter on the product of two fields - I want to look for the count of claim_id's where unit_price * quantity is greater than $150.  The fields unit_price and quantity exist in different residents/tables.  I realize I could calculate this in the data load but wanted to know if it's possible to accomplish this in set analysis.

Normally I'd filter one field, like this:

count(distinct {<quantity ={">150"}>} claim_id)

But I'm trying to do the above, with unit_price * quantity ">150"

1 Solution

Accepted Solutions
marcus_sommer

Within a classical set analysis it's not possible because it's a column-level evaluation and here you need a row-level evaluation. It's often possible to include such stuff within a set analysis syntax but logically it's then an if-loop. Therefore why not using one like:

if(unit_price * quantity >150, count(distinct claim_id))

Moving the measure-fields into a single-table and doing there such calculation within extra fields may create significantly benefits in regard to the easiness of UI developments as well as to the performance.

- Marcus

View solution in original post

2 Replies
marcus_sommer

Within a classical set analysis it's not possible because it's a column-level evaluation and here you need a row-level evaluation. It's often possible to include such stuff within a set analysis syntax but logically it's then an if-loop. Therefore why not using one like:

if(unit_price * quantity >150, count(distinct claim_id))

Moving the measure-fields into a single-table and doing there such calculation within extra fields may create significantly benefits in regard to the easiness of UI developments as well as to the performance.

- Marcus

dataDrivenDecision
Contributor
Contributor
Author

Thx Marcus 🙂

and thank you for the explanation why I couldn't accomplish it the other way.