Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9008

Re: TOP N and Bottom N

$
0
0

Hello Stefan,

 

this is possible.

You can create a single Query with the two new variables TOP_N and BOTTOM_N, so that the user alway has to manually fill in a value when executing the query.

 

In Design Studio I created two Drop Down Boxes, one for TOP and the other for BOTTOM selection.

On each I added Items "5,10, 20, all", so the user can select  Top-5, Top-10 etc.

 

For "On select" I added the following code:

"VAR_2014_TOP" and "VAR_BOTN" are the names of the TOP-N variables which were defined in the query.

 

-----------------------

 

DROP_BOTN:

-------------------------

 

APPLICATION.setVariableValueExt("VAR_2014_TOP","");

DROP_TOP_N1.setSelectedValue("");

APPLICATION.setVariableValueExt("VAR_BOTN",DROP_BOTN.getSelectedValue());

 

 

 

-----------------------

DROP_TOP_N1

-------------------------

 

APPLICATION.setVariableValueExt("VAR_BOTN","");

DROP_BOTN.setSelectedValue("");

APPLICATION.setVariableValueExt("VAR_2014_TOP",DROP_TOP_N1.getSelectedValue());

 

------

With this script the user can select Top or Bottom values. With each selection the other value will be reset.

 

In the Startup-script i added the follwing line:

 

APPLICATION.setVariableValueExt("VAR_2014_TOP", "5");

 

So Top-5 is always preselected.

 

 

I hope this helps you.

 

Regards

 

Steffen


Viewing all articles
Browse latest Browse all 9008

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>