Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to get the previous selection

Hi,

Simply I have a nested data (Parent-Child mode) so I'm displaying the data for the current selection record and all related children.

However, one issue I have is I can't in my current set analysis filter statement use $1 to get the previous selection since I need to use '1' to get data beyond the current selection. So, how can I get -within my set analysis- the previous selection for a certain record (which is the ParentId of the current record) in order to pass it on and filter the data.

My current expression is something like this:

sum( {1<HID={"$(vHID)*"},CurrentLevel={'>=$(=vCurrentLevel)'}>} Amount)

And I just want to add another condition like: ParentId = Previous Selection ID.

Thanks!

6 Replies
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Try adding something like this:

ParentID = P({$1} ParentID)

cheers,

Oleg Troyansky

www.masterssummit.com - take your QlikView skills to the next level!

Not applicable
Author

Thanks Oleg, how could I use the P() function in a parameter expression in order to pass the value over?

Anonymous
Not applicable
Author

p() represents a set of possible values

and

$1 - Represents the previous selection

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Louie,

this is a Set Analysis function, not the parameter expression. Look it up in the Help article "Set Analysis".

Oleg

Not applicable
Author

Thanks, how can I display the value of the P() function on my straight table? I tried to add an expression, but I couldn't! I just want to see the value of the ParentID = P({$1} ParentID) just for debugging purposes.

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Try this:

only({<ParentID = P({$1} ParentID) >}  ParentID )