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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to select a field on the basis of selection on another field?

In set analysis, how do we write the condition that on selection of field a(value x), select another field b( value b) should be selected?

eg:

Benchmark (FLD A)

Q2

Q3

Q4

SourceVersion (FLD B)

2013 BUDQ2

2013 BUDQ3

2013 BUDQ4

2014 BUDQ2

2014 BUDQ3

On selection of Benchmark = Q2,Sourceversion should be 2013 BUDQ2 (Year selection is already made)

1 Solution

Accepted Solutions
Not applicable
Author

if there exists a relation ship b/w 2 fields are those belong to the same table.

For example your data might be like this

 

Test2:

Load * Inline [
Benchmark,SourceVersion, Sales
Q2, 2013 BUDQ2, 10
Q3, 2013 BUDQ3, 20
Q4, 2013 BUDQ4, 30
Q2, 2014 BUDQ2, 40
Q3, 2014 BUDQ3, 50
]
;

Now you can write set analysis like this

 

=SUM({<Benchmark=P({<SourceVersion>})>}Sales)

If this will not solve your issue, post your sample app..

View solution in original post

9 Replies
Anonymous
Not applicable
Author

You need to have relation between those two fields first. then you can create a field event trigger in document properties.

Document properties>> Triggers>> Field Event Triggers>> On Select(add action)>> Selection in Field

In selection in field trigger, you can pass P(Benchmark) for SourceVersion field value.

Hope it helps.

Smita

Not applicable
Author

Hi,

The 2 fields are from the same table or not?


Not applicable
Author

Not sure what you are trying to do here.

For your basic requirement assuming the field values in (FLD B) are not too many you could do a simple if condition something like if(getfieldselections(FLD A)='Q2', fieldvalue('FLD B',2)).

Not applicable
Author

if there exists a relation ship b/w 2 fields are those belong to the same table.

For example your data might be like this

 

Test2:

Load * Inline [
Benchmark,SourceVersion, Sales
Q2, 2013 BUDQ2, 10
Q3, 2013 BUDQ3, 20
Q4, 2013 BUDQ4, 30
Q2, 2014 BUDQ2, 40
Q3, 2014 BUDQ3, 50
]
;

Now you can write set analysis like this

 

=SUM({<Benchmark=P({<SourceVersion>})>}Sales)

If this will not solve your issue, post your sample app..

Anonymous
Not applicable
Author

I did try using triggers. But it doesnt work. My fields are not related. Thats why I guess

Anonymous
Not applicable
Author

No. They are unrelated

Anonymous
Not applicable
Author

The main problem is that these two fields are not related.

Anonymous
Not applicable
Author

Thank you. It worked fine.

Anonymous
Not applicable
Author

Load * Inline [
Benchmark2,SourceVersion, Sales
Q2, 2013 BUDQ2, 10
Q3, 2013 BUDQ3, 20
Q4, 2013 BUDQ4, 30
Q2, 2014 BUDQ2, 40
Q3, 2014 BUDQ3, 50
]
;

What if I have to do same thing with another field also Benchmark2?

If I apply the same process, it simply does not work.