Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
rdsuperlike
Creator
Creator

Trigger--listbox

I have a list box with with Qtr = Q1, Q2 and Q3.

I have another list box with Final Qtr = Q1, Q2, Q3.

When I select on Qtr= Q1, I want to create a trigger to pick up Final Qtr = Q1 too.

Also, In the selection box i want to see only Qtr = Q1 selected.

I dont want user to see that calculation happening at backend. So Current selectio box should show only Qtr = Q1.

Any help?

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Check the attached sample qvw. For not showing the selection in the current selection box, play the trick of HidePrefix system variable in the script.

View solution in original post

10 Replies
SergeyMak
Partner Ambassador
Partner Ambassador

Hi,

The answer is bellow.

Try to use Field Event Trigger

Capture.PNG

Regards,
Sergey
rdsuperlike
Creator
Creator
Author

works fine.

But it doesn't work if I select Qtr 2 and 3 both.

I want that to be reflected too.

Also, is there a way that If i use current selection box, I dont show final qtr values in the current selection box?

jonathandienst
Partner - Champion III
Partner - Champion III

Do you really need a trigger? I would define a globally evaluated variable (ie one with a leading = sign), like this (if you define it in your script (assuming Qtr is a string field):

Set vMaxQ = =MaxString(Qtr);   // the = = is not a typo

This variable will contain the maximum possible Qtr, so if nothing is selected, it will be the max Qtr in your model, or if something is selected, it will contain the selected value (actually the max of the selected values).

You can use vMaxQ in set expressions and chart captions

     Sum({<Qtr = {"$(=vMaxQ)"}>} Sales)  //expression

     ='Sales for ' & vMaxQtr                          //caption or label

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
rdsuperlike
Creator
Creator
Author

No. We dont want to add any changes to the script

abhaysingh
Specialist II
Specialist II

Hi, you need to set Field Event Trigger

select field qtr, set add action , go to select in field and pass field Final Qtr and in select string write getfieldselection(Qtr).

make sure both field value should be same

regards

Abhay

tresesco
MVP
MVP

Check the attached sample qvw. For not showing the selection in the current selection box, play the trick of HidePrefix system variable in the script.

jonathandienst
Partner - Champion III
Partner - Champion III

If you don't want to change the script, then define the variable in the Variable Overview dialog. Define it with a leading = sign:

     =MaxString(Qtr)



Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable

Hi tresesco

I wonder if you can help me on how to hide the list box , take the example of your qvd , but to try do not hide me the picture, which is what I need , I attached to the example and mine , for you to see

Help me

tresesco
MVP
MVP

Sorry, did not get your point.