Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Partner
Partner

How to filter within the range of the value of a selection?

Hi,

I have a table that looks similar to below, with the aim to find similar alternatives to one selection:

DimensionValueStat 1Stat 2
ABC123512
DEF456434
GHI789378
JKL012227

 

So essentially what I would like to do is to create a sheet where you select one "Dimension", and the object displays the alternatives that are within 1 in value.

Example:

If I select "DEF456" I want the visualization to show the rows for ABC123, DEF456 AND GHI789. If I select JKL012 it should display JKL012 and GHI789. 

 

Tags (1)
Labels (1)
1 Solution

Accepted Solutions
Highlighted
Specialist III
Specialist III

Re: How to filter within the range of the value of a selection?

Hi,

What you think about a proposal based on data islands ?

In the load script I created a table not connected with the model

INPUTS:

LOAD * INLINE [
    Dimension, Value, Stat 1, Stat 2
    ABC123, 5, 1, 2
    DEF456, 4, 3, 4
    GHI789, 3, 7, 8
    JKL012, 2, 2, 7
];

ISLAND:
Load distinct Dimension as selected_dimension,Value as selected_Value  resident INPUTS;

 

And for users, I will display the dimension[Selected_dimension]

Capture.PNG

And I will display the results I want based on the calculated dimension

=if(Value=selected_Value+1 or Value=selected_Value-1,Dimension)

 

Outputs:

Capture.PNG.

2-

Capture.PNG

3

Capture.PNG

Cheers,

 

Regards,
Taoufiq ZARRA

View solution in original post

3 Replies
Highlighted
Specialist III
Specialist III

Re: How to filter within the range of the value of a selection?

Hi,

What you think about a proposal based on data islands ?

In the load script I created a table not connected with the model

INPUTS:

LOAD * INLINE [
    Dimension, Value, Stat 1, Stat 2
    ABC123, 5, 1, 2
    DEF456, 4, 3, 4
    GHI789, 3, 7, 8
    JKL012, 2, 2, 7
];

ISLAND:
Load distinct Dimension as selected_dimension,Value as selected_Value  resident INPUTS;

 

And for users, I will display the dimension[Selected_dimension]

Capture.PNG

And I will display the results I want based on the calculated dimension

=if(Value=selected_Value+1 or Value=selected_Value-1,Dimension)

 

Outputs:

Capture.PNG.

2-

Capture.PNG

3

Capture.PNG

Cheers,

 

Regards,
Taoufiq ZARRA

View solution in original post

Highlighted
Partner
Partner

Re: How to filter within the range of the value of a selection?

It worked! I did some small changes to your script. The dimensions can have several rows (one per month), where I wanted to sum the stat columns over all rows, but only see the "latest" values.

Instead of putting an expression in the dimension I created a variable set to Avg(selected_value), and then created a set expression as:

Alt(Avg({<value={">=$(=$(vValueComp)-1)<=$(=$(vValueComp)+1)"},Date={$(vMaxDate)}>} value),0)

The "alt" is there to be able to filter out rows that otherwise would be seen as null when adding measures "Sum(Stat)"

Highlighted
Specialist III
Specialist III

Re: How to filter within the range of the value of a selection?

Awesome

Regards,
Taoufiq ZARRA