Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
abhishek2
Contributor III
Contributor III

Limiting the numbers of rows used to create a scatter plot using a variable

Hi All,

I am trying to create a scatter plot and dynamically limiting the number of rows that it uses to calculate the values.  Below is the sample data that I am using.

How do I use a variable to limit the data rows using the counter field?  Foe example, I only want to include rows where Counter <=5 or Counter <=8. Essentially controlling the scatter plot for Top N rows using a variable to calculate the values dynamically. 

I can use counter in the filter pane. However, I need to give limited values like Top 5, Top 10, Top 15 etc. to limit the rows used for calculation of the values.

Thank you for the help.

AXYCounter
A1251
A1522
A1133
A1344
A1555
A1546
B1411
B1332
B1543
B1424
B1445
B1526
B1547
B1358
B1329
B12510
B11111
B11512
B15513
B14214
B15315
A1137
A1558
A1359
A13210

 

Regards, Abhishek.

Labels (4)
2 Solutions

Accepted Solutions
Anil_Babu_Samineni

Try to follow this

1) Create one Variable like input box

2) Create the measure like Sum({<Counter={"$(Variable1)"}>} Counter)

3) Else, You can use 2 variables as well like 1st step

4) Expression should be Sum({<Counter={">=$(Variable1)<=$(Variable2)"}>} Counter)

etc..

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

abhishek2
Contributor III
Contributor III
Author

Thank Anil! 

I did try this approach but was getting an error as I was using the less than symbol outside the brackets. 

I updated the solution to the one given below and it works like a charm!

Sum({<Counter ={"<=$(Variable1)"}>} X). 

 

Regards, Abhishek

View solution in original post

2 Replies
Anil_Babu_Samineni

Try to follow this

1) Create one Variable like input box

2) Create the measure like Sum({<Counter={"$(Variable1)"}>} Counter)

3) Else, You can use 2 variables as well like 1st step

4) Expression should be Sum({<Counter={">=$(Variable1)<=$(Variable2)"}>} Counter)

etc..

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
abhishek2
Contributor III
Contributor III
Author

Thank Anil! 

I did try this approach but was getting an error as I was using the less than symbol outside the brackets. 

I updated the solution to the one given below and it works like a charm!

Sum({<Counter ={"<=$(Variable1)"}>} X). 

 

Regards, Abhishek