thanh huynh Posted June 30, 2023 Share Posted June 30, 2023 The report I'm working on has 3 measures (sales$, cases, weights). But instead of showing a column for each measure, I want the user to select a measure from a drop down menu. And based on that selection, the appropriate measure will be displayed in the report. Link to comment Share on other sites More sharing options...
Clinton Etheridge 2 Posted July 3, 2023 Share Posted July 3, 2023 Hello @thanh huynh I noticed your question this evening and it seems you have received no responses yet.Here is an example using the legacy sample CAR file that contains the measures: SALES, DEALER_COST, RETAIL_COSTTABLE FILE CARSUM&MEASURE.(<Sales,SALES>,<Dealer Cost,DEALER_COST>,<Retail Cost,RETAIL_COST>).Select Measure.BY COUNTRYBY CARON TABLE PCHOLD FORMAT HTMLON TABLE SET HTMLCSS ONON TABLE SET STYLE *UNITS=IN, SQUEEZE=ON, ORIENTATION=PORTRAIT,$TYPE=REPORT, GRID=OFF, FONT='ARIAL', SIZE=9,$TYPE=TITLE, STYLE=BOLD,$ENDSTYLEENDSimply replace the options for the measures in my example with the measures you noted above.i.e. &MEASURE.(<Sales,sales$>,<Cases,cases>,<Weights,weights>).Select Measure.Note the parameter value pairs represent the value you want to prompt the user for followed by the value you want to pass back into your WebFOCUS Report/Graph request, that is prompt for "Sales" and pass "sales$" into the parameter &MEASURE. Link to comment Share on other sites More sharing options...
David Beagan Posted July 5, 2023 Share Posted July 5, 2023 This can also be done in InfoAssist too.Documentation: InfoAssist User's Manual, Adding Parameters for Data Selection at Run Time Link to comment Share on other sites More sharing options...
thanh huynh Posted July 11, 2023 Author Share Posted July 11, 2023 Thank you Clinton and David. I'll try these out and will reply back on the results. Link to comment Share on other sites More sharing options...
thanh huynh Posted July 11, 2023 Author Share Posted July 11, 2023 These 2 solutions seem to work to return 1 column of data, but how would you do this for multiple sales, cases, or weight columns?Say there are 2 sales columns, 2 cases columns, and 2 weight columns. How could the report display both Sales columns if the parameter selected was 'Sales'. Link to comment Share on other sites More sharing options...
David Beagan Posted July 11, 2023 Share Posted July 11, 2023 Take the answer provided Clinton Etheridge so that the line:&MEASURE.(<Sales,SALES>,<Dealer Cost,DEALER_COST>,<Retail Cost,RETAIL_COST>).Select Measure.Is changed to this:&MEASURE.(AND(<Sales,SALES>,<Dealer Cost,DEALER_COST>,<Retail Cost,RETAIL_COST>)).Select Measure. Link to comment Share on other sites More sharing options...
thanh huynh Posted July 11, 2023 Author Share Posted July 11, 2023 Hi David,I see what the 'AND' is doing, but I don't think it's correct for what I'm looking for.Hopefully, I can explain it a bit better this time around.Say these are the fields I'm working with:Sales1Sales2Cases1Cases2Weight1Weight2What I'm trying to do is if a user selects Sales as the measure, Sales1 and Sales2 is shown like the mock up below.And it'll be the same for Cases and Weight. If Cases is selected, Cases1 and Cases2 would be shown. Link to comment Share on other sites More sharing options...
Solution David Beagan Posted July 11, 2023 Solution Share Posted July 11, 2023 Then you could do this:&MEASURE.(<Sales,Sales1 Sales2>,<Cases,Cases1 Cases2>,<Weight,Weight1 Weight2>).Select Measure. Link to comment Share on other sites More sharing options...
thanh huynh Posted July 11, 2023 Author Share Posted July 11, 2023 Thanks David. That worked beautifully.Is there a way to update the column name within that line of code? Link to comment Share on other sites More sharing options...
David Beagan Posted July 11, 2023 Share Posted July 11, 2023 I don't understand what you are asking. Link to comment Share on other sites More sharing options...
thanh huynh Posted July 11, 2023 Author Share Posted July 11, 2023 with this line&MEASURE.(<Sales,Sales1 Sales2>,<Cases,Cases1 Cases2>,<Weight,Weight1 Weight2>).Select Measure.The columns will be labeled Sales1, Sales2, Cases1, Cases2, Weight1, Weight2.Is there a way to update that line so that Sales1 would be labeled as Qtr1Sales? Link to comment Share on other sites More sharing options...
David Beagan Posted July 11, 2023 Share Posted July 11, 2023 &MEASURE.(<Sales,Sales1 AS 'Qtr1Sales' Sales2>,<Cases,Cases1 Cases2>,<Weight,Weight1 Weight2>).Select Measure.By the way, you can put column titles in the Master metadata file, then you don't have to bother with it in the fex. Link to comment Share on other sites More sharing options...
thanh huynh Posted July 12, 2023 Author Share Posted July 12, 2023 Thank you David for your help. I really appreciate it. Link to comment Share on other sites More sharing options...
David Beagan Posted July 12, 2023 Share Posted July 12, 2023 You're welcome. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now