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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
suzel404
Creator
Creator

Range on each rows.


Hi all,

I have range. When I select Range I can get the previousRange et ForwardRange.

Example : I select 1500 - 200 range I can see in straight table :

1250 - 1500

1500 - 2000

2000 - 2500

Is there a way to get this directly in dimension without using the Set Analysis in expression  ?

Thank you for your help.

1 Solution

Accepted Solutions
tresesco
MVP
MVP

You can, but that would make things more complex. Calculated dimension:

=ValueList( $(=chr(39)&Concat({<Range=>}Aggr(Only({<Id={$(=Id-1), $(=Id), $(=Id+1)}, Range=>}Range),Range),chr(39)&','&chr(39))&chr(39)))

PFA

View solution in original post

6 Replies
Not applicable

Hi,

Since you have written  "Range=" in your st. table expression, the table does not get affected for Range selections.

Change your exp to '=Only({<Id={$(=Id-1), $(=Id), $(=Id+1)}>}Range)' and check, you will get one row.

Regards,

Prabhu

suzel404
Creator
Creator
Author

Hi Prabhu,

If I use " Only({<Id={$(=Id-1), $(=Id), $(=Id+1)}>}Range)'" I get one row. I don't want one row but 3 rows.

I select range 1500 - 2000 the corresponding Id is 811. So I would like to get :

1250 - 1500 (corresponding Id = 810, previous range)

1500 - 2000 (corresponding Id =811,  my current selection)

2000 - 2500 (corresponding Id =812, forward range)

I would like this result calculated in Dimension tab and not in expression Tab, if it is possible.

tresesco
MVP
MVP

You can, but that would make things more complex. Calculated dimension:

=ValueList( $(=chr(39)&Concat({<Range=>}Aggr(Only({<Id={$(=Id-1), $(=Id), $(=Id+1)}, Range=>}Range),Range),chr(39)&','&chr(39))&chr(39)))

PFA

suzel404
Creator
Creator
Author

Hi Tresesco,

Thank you. Expression is more complex but very interesting. One last thing, how can I add value in expression:

if range = 1500 - 2000, 10

if range = 1250 - 1500, 7

if range = 1500 - 2000, 2

tresesco
MVP
MVP

The complexity deepens from here. . You have to write expression like:

=If( Valuelis(....)='This', 'ThenThis', If(....))

The same can be cleverly written using Pick(Match(....)).

But I guess you should rethink if this is really needed or you have alternate option.

suzel404
Creator
Creator
Author

Many Thank !!