Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Rsaiq
Creator
Creator

Filtering Data Automatically using Master Measure.

Hi,

I am working on filtering data on front end using Master Measures. So that  user can drag directly that master measure into table and it will get filtered as per our criteria which we need to add in the master measure.

 

Below is my table

Product Name Address Amount
Product1 Sam N/A 100
Product1 Alex Not N/A 200
Product1 Smith N/A 300
Product2 Jhonson N/A 400
Product2 Mattew Not N/A 500
Product2 Andrew Not N/A 600
Product2 Alex Not N/A 650
Product3 Alex N/A 680
Product3 Samuels N/A 700
Product3 Aaron Not N/A 800
Product3 David N/A 900
Product3 Phillips N/A 1000
Product4 Jhony N/A 1100
Product4 Mark Not N/A 1200

 

My requirement is to add below criteria in the master measure :

Rsaiq_1-1695648526111.png

 

 

 

So per above criteria whenever user just add the master measure on front end the table should filter and produce below result:

Rsaiq_3-1695633600537.png

Could you please help me to get this type of calculation on the front end master measure.

Thanks in advance

 

 

 

 

 

1 Solution

Accepted Solutions
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi there,

I'm not sure I understand all the intricacies of your logical conditions, but overall, you need to formulate a complex Set Analysis condition that would select certain data elements based on the formulated rules. 

1. Determine what field needs to be selected from. For example, If you are selecting Orders, then Order ID could be the best field. Or, the Amount field could be used for these conditions, if you are just selecting Amounts based on these rules.

2. Since you have multiple rules that need to be united (logical +), you can formulate each Rule in a separate Set Analysis condition within the function P() and then unite multiple P() functions together.

So, something like this:

sum( { <

     Amount = P({<Product={'Product1'}>}) + P({<Product={'Product2'}, Address={...}>}) + P(...) + P(...)

> }   Amount)

 

To learn more advanced development techniques, including my session on Advanced Set Analysis, check out the agenda of the Masters Summit for Qlik - coming soon to Orlando and to Dublin!

View solution in original post

2 Replies
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi there,

I'm not sure I understand all the intricacies of your logical conditions, but overall, you need to formulate a complex Set Analysis condition that would select certain data elements based on the formulated rules. 

1. Determine what field needs to be selected from. For example, If you are selecting Orders, then Order ID could be the best field. Or, the Amount field could be used for these conditions, if you are just selecting Amounts based on these rules.

2. Since you have multiple rules that need to be united (logical +), you can formulate each Rule in a separate Set Analysis condition within the function P() and then unite multiple P() functions together.

So, something like this:

sum( { <

     Amount = P({<Product={'Product1'}>}) + P({<Product={'Product2'}, Address={...}>}) + P(...) + P(...)

> }   Amount)

 

To learn more advanced development techniques, including my session on Advanced Set Analysis, check out the agenda of the Masters Summit for Qlik - coming soon to Orlando and to Dublin!

Rsaiq
Creator
Creator
Author

Many Thanks... @Oleg_Troyansky ,it is perfectly working as expected. Used below expression for Master Measure

sum( { <Amount = P({<Product={'Product1'}>})
+ P({<Product={'Product2'}, Name={'Mattew'},Address-={'N/A'}>})
+ P({<Product={'Product3'}, Name={'Aaron','David'}>})
> } Amount)