Limit columns based on variable value
Gurus,
My requirement;
User will enter a value "A" in the variable and based on the value i need to limit
the columns in the output. for example in the query designer i have 6 fields in
Rows, in Free Chars i have the field with variable which user will enter. if the value
entered is "A" only 4 fields should appear on the report else if value is "B" only
the other 2 fields should appear.
Is there a way accomplish this...please suggest
Thanks with points in advance...
Geni,
Are u using the Excel based Analyzer as your Front End?
If so you can run a small VBA (on event SAPBEXonrefresh) that will hide columns based on the value of the cell that displays the value of the variable that the user is setting.
See code i posted in Re: How do I make cells "0" and not blank for an example.
Is this what you are after?
Hope it helps,
Gili
Similar Messages
-
Bex query that returns variable number of columns based upon variable value
I have a request to create a query that, at excution time, has a variable for 'nbr of months', and based on the value entered by the user, returns data for only the specified number of months. Value that can be entered can vary from 1 to 12. A simple example is, if the user enters 1, then they would only want to see one column, and if they entered 6, then they'd like to see 6 columns in the workbook. All suggestions on how to implement this dynamic columns on a workbook will be appreciated.
Thanks.
BNHi,
Do this->
1) first create a New Structure in Rows-> Place your New Selection and drag your KF.
2) Nw Create a New Formual under this structure. Now Create a Formula variable ( "ZFVXXX")with user-entry and ready for input and dimension as NUmber. and place in formula area. And hide this formula.
3)Now Create a New Customer-Exit variable on 0CALMONTH name as "ZCECMON" with following atrribute->Mandatory, Range(Interval) and remove check for Ready for entry.
4)Drag your 0CALMONTH in Rows above That Structure and restrict it to "ZCECMON".
5) Now go to CMOD and write this code.
INCLUDE ZXRSRU01 *
DATA: L_S_RANGE TYPE RSR_S_RANGESID. 'In global area
DATA: LOC_VAR_RANGE LIKE RRRANGEEXIT. 'In global area
DATA: zmonth like /bi0/0calmonth.
CASE I_VNAM.
WHEN 'ZCECMON'.
IF i_step = 2.
LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
WHERE VNAM = 'ZFVXXX'.
zyear = sy-datum(4).
zmonth = sy-datum+4(2).
l_s_range-low = zmonth.
zmonth = zmonth + loc_var_range-low.
l_s_range-HIgh = zmonth.
l_s_range-sign = 'I'.
l_s_range-opt = 'BT'.
APPEND l_s_range TO e_t_range.
ENDIF.
ENDCASE.
6) activate the porject and go to rsrt and run there first.
Regards,
San!
Message was edited by: San! -
How to put the column name and variable value in the alert message.
Dear,
how can i put the column name and variable value in the alert message text. i want to display an alert which tell the user about the empty textboxes. that these textboxes must be filled.
Regards:
Muhammad Nadeem
CHIMERA PVT. LTD.
LAHORE
[email protected]Hello,
The name of the item that fires the current trigger is stored in the :SYSTEM.TRIGGER_ITEM system variable.
The value contained in this item can be retrived with the Name_In() built-in
value := Name_In( 'SYSTEM.TRIGGER_ITEM') ;
LC$Msg := 'The item ' || :SYSTEM.TRIGGER_ITEM || ' must be entered' ;
Set_Alert_Property('my_alert_box', ALERT_MESSAGE_TEXT, LC$Msg ) ;
Ok := Show_Alert( 'my_alert_box' ) ;
...Francois -
Dispaly or Hide a column based on Prompt Value
Hi All,
How can I Display or Hide a Column based on Prompt Value selected?
On my dashboard I have a Report/Request and a Dashboard Prompt.
Dashboard Prompt has three values, say: *'A', 'B' and 'C'*.
And my report/request has three columns named *'Field1', 'Field2'* and Field3'.
What I am trying to achieve is that whenever user selects prompt values as *'A' or 'B'* all the three fields on my report named *'Field1', 'Field2' and Field3'* should be displayed, however whenever user selects prompt values as *'C'* only fields named *'Field1' and 'Field2'* should be displayed.
Thanks,
DeepakHi Bhavna,
I tried using View Selector, however I am not able to achieve the required functionality with that.
I created a Request with 3 columns in it, then I switched to criteria and added another table to that. The new table automatically got the similar 3 columns used in the first report. Now when I tried to delete one of those columns from the new report, it also got deleted from the first report.
All the views are dependent, changes made to one are reflected in other.
Can't figure it out, where am I going wrong?
Thanks,
Deepak -
How to select different Querys based on Variable Value
Hi guys i need to know how to select different Querys, based on variable values selected by the user, i try to do it using a Web Template but i don´t know how to program a Dynamic Query.....
I hope sombody could help me with this
Message was edited by: Oscar DiazHi Diaz,
Can you explain the exact scenario which you are looking for!!!
regards
Happy Tony -
Create a derived column based on a value within the file name
I am importing a CSV file which is easy enough, but I have an issue where I need to manufacture a couple of column values based on the filename of the input. So this same process will import different types of records to the same table in sql server.
I need to pull out the record code from the file name.
For instance, say I can use the same package to input two different CSV files. One is named Input_M02_Data.csv and one named Input_B15_Data.csv. I need to create a derrived column and store the record code there (i.e.: M02 or B15) based
on which file it came out of.
fyi-
I also need to create a second column for Dept based off of the file name as well. M02 is dept 45 and B15 is dept 99 which I also need to insert into this table when I import the data from the .csv file.
Any help is greatly appreciated!Hi Jason,
According to your description, you want to add two derived columns based on the file name to also insert into table. One stores the value between two “_” within file name, another stores the department based on that column.
If in this scenario, we can add a variable FileName that stores the filename, then add the two variables as derived columns like below in the Derived Column Transformation:
Name:
SUBSTRING(@[User::FileName],FINDSTRING(@[User::FileName],"_",1)+1,FINDSTRING(@[User::FileName],"_",2)-(FINDSTRING(@[User::FileName],"_",1)+1))
Dept:
@[User::Name] =="M02"?"dept 45":@[User::Name] =="B15"?"dept 99":"dept 00"
The following screenshot is for your reference:
If there are any other questions, please feel free to ask.
Thanks,
Katherine Xiong
If you have any feedback on our support, please click
here.
Katherine Xiong
TechNet Community Support -
SSRS Matrix report to show or hide year column based on parameter value "Date" selected.
Hey experts!
I have a requirement an ssrs matrix report should display columns (year/s) based on parameter value (date/s).
My Dataset fileds are: Product, Year_name, Month_name, Date
Currently my report output looks like this-
Param Date: 2013-08-01 00:00:0.000
Product +Calender2011 +Calender2012 -Calender 2013........ +Calender2014
Total
Total Jan13 Feb 13 Mar13.. Dec13 Total Total
Abc 100
220
10 20 30....... 20 250 400
Xyz 110
200 50 80 40....... 30 450 600
My requirement: if I'm selecting Date parameter value as '2013-xx-xx' I should only able to see Year column 'Calender2013' and rest of the years should hide. Similarly If I'm selecting Date parameter value as '2014-xx-xx' I should only able to
see Year column 'Calender2014' .
Appreciate your kindly help.
AfanHi Afan,
According to your description, you want to only show the selected year on your report, right?
In this case, you need to get the year from the date parameter using the expression below
=Year(Parameters!Date.Value)
And then use the expression below to get the year from Year_Name field.
=Right(Fields!Year_Name.Value,4)
Then add a filter to the dataset to filter the data like below
Expression:=Year(Parameters!Date.Value)
Operator:=
Value:=Right(Fields!Year_Name.Value,4)
Reference
http://msdn.microsoft.com/en-IN/library/dd255287.aspx
If you have any questions, please feel free to ask.
Regards,
Charlie Liao
TechNet Community Support -
How to retrive new logical column based on flag values in table.
Hi,
i have two tables in rpd
1.file table contains the coulmns------->date,file_count,record_count,cldm_stg,cmsa_stg,archive_stg
2.rejection table columns---------> are same as above
both have same common columns.my requirement is publish a dashboard like:
date | land_files count |alnd_recordscount| target_files count|target_records count|Rejection filecount|rejection record count
These report ineed retrive from those two tables.based on flag values.taget countcomes when all stg values set to ='y'
i.e(cldm_stg='y' and cmsa_stg='y'and archive_stg='y') if not then it will be in rejection file.
Please give solution how to achive my output.
nQSError: 14026] Unable to navigate requested expression: Target_record:[DAggr(FILE_CONTROL.Target_record by [ FILE_CONTROL.FILE_NAME, REJECTED_FILES.FILE_NAME, REJECTED_FILES.NO_OF_ROWS, File_landing.NO_OF_ROWS, File_landing.FILE_LOAD_DATE] SB FILE_CONTROL)]. Please fix the metadata consistency warnings. (HY000)
Edited by: user8767586 on Jan 12, 2010 4:29 AMTanks for ypur reply .only two tables are there named as above.i taken file_control as a fact table.
and i create one new tablecalled target in bmm layer taking logical source as file_control(fact table). and iset the where clause for the new table.and i create a new measure called target_file and target_records.in where clause my query is like
dwbidb."".AUDIT_PROD.FILE_CONTROL.ARCHIVE_STATUS = 'Y' AND dwbidb."".AUDIT_PROD.FILE_CONTROL.CMSA_STATUS = 'Y' AND dwbidb."".AUDIT_PROD.FILE_CONTROL.LND_STATUS = 'Y' AND dwbidb."".AUDIT_PROD.FILE_CONTROL.SCRIPT_STATUS = 'Y' AND dwbidb."".AUDIT_PROD.FILE_CONTROL.STG_STATUS = 'Y'
please tell me if this is right way to achive mt report. and tell me difference between fragmentation and whereclause.for my requrement i ahve to follow which method either fragmentation or whereclause.and in rpd there are no errors and warnings.but in answers i get a follwing error
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 14026] Unable to navigate requested expression: TARGET_FILECOUNT:[DAggr(TARGET.TARGET_FILECOUNT by [ TARGET.FILE_NAME] SB TARGET)]. Please fix the metadata consistency warnings. (HY000)
SQL Issued: SELECT TARGET.FILE_LOAD_DATE saw_0, TARGET.TARGET_FILECOUNT saw_1, TARGET.TARGET_FILECOUNT saw_2 FROM AUDIT_PROD ORDER BY saw_0.
Please tell me to achive my report.
Regards
Edited by: user8767586 on Jan 12, 2010 5:21 AM
Edited by: user8767586 on Jan 12, 2010 5:21 AM
Edited by: user8767586 on Jan 12, 2010 5:24 AM -
Changing display of item in column based on its value
Hi,
I'm confused as to how I can change the display attributes of an item in a column based on that items value. I've grepped through the forums and it seems there are ways to do this in the report query but that seems inefficient. My preferred method would be at the column level, I could set up some logic that says "if the value is X then display A and if the value is Y then display B". In this case A and B could be a snippet of HTML to display an image that represents the value.
Seems reasonable that this app would have this functionality and I'm sure it's there, I just can't seem to find it.
Help! Suggestions welcome, heckling encouraged!
Thanks,
JonJon,
You should probably start storing the images in a custom table as described here:
http://www.oracle.com/technology/obe/apex/apex31nf/apex31blob.htm
The following column is taken from the Products query in the sample application (page 3):
decode(nvl(dbms_lob.getlength(p.product_image),0),0,null,'<img src="'||apex_util.get_blob_file_src('P6_PRODUCT_IMAGE',p.product_id)||'" height="75" width="75" />') img
Note, getting this configured is a little tricky the first time. Notice that there is an item from page 6 referenced. Page 6 contains that item and a DML process both of which are needed for everything to work. Read more here:
http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e10499/advnc.htm#BCGGJHEF
Regards,
Dan
http://danielmcghan.us
http://sourceforge.net/projects/tapigen -
To find a column based on a value
Hello Experts,
I have an urgent requirement. Based on a value in a particular column in a table, i have to select the previous column value.
I have tried using select statement with more compliaction which will affect the performance. Is there any user friendly logic to implement this.
Thanks in Advance!!
Moderator Message: Duplicate post, thread locked.
Edited by: Suhas Saha on Mar 5, 2012 3:01 PMI didnt get u...
plz post with code and proper information... -
Hide column based on parameter value
Hi All,
I have requirement where i need to hide one column based on my input parameter value.per example
if my parameter say DISPLAY is Yes then i need to hide the column AMOUNT..
how to achieve this... Please help.
Thanks
BharatHi Bharat,
You can do it following the steps explained in the documentation :
http://docs.oracle.com/cd/E12844_01/doc/bip.1013/e12187/T421739T481157.htm#4535373
regards
Jorge
p.s. If this answers your question then please grant the points and close the thread -
How do you lookup multiple values in different columns based on variable criteria?
Essentially, I'd like to be able to do a Vlookup but instead of searching for one value only, search for multiple values in separate columns. A smaller version of my current spreadsheet as an example...
Attack Type ->
Fire
Water
Grass
Fire
1/2x
2x
1/2x
Water
1/2x
1/2x
2x
Grass
2x
1/2x
1/2x
Fire/Water
1/4x
1x
1x
Fire/Grass
1x
1x
1/4x
Grass/Water
1x
1/4x
1x
The headers are the attack types and the list of types to the left are the receiving Pokemon. Fire does half damage (1/2x) to fire types, Water does double damage (2x) to fire types, etc. I'd like to be able to search for specific damages for each type. For example, I'd like to find a Typing that recieves half (1/2x) damage from Fire-type attacks but also recieves double (2x) from Grass-type attacks. I do want more than just two search criteria though seeing as the actual table is much, much larger.
I've tried assigning number values to each damage multiplier and then merging all of them together for a specific typing and doing a VLOOKUP based on checkboxes determining what damage multiplier I want in a few specific types, the rest being filled in to the standard of 1x but the result isn't correct most of the time.Hi Mitchell,
VLOOKUP can be set for accept either an 'exact match' or a 'close match'. Your 17 digit 'number' is actually a 17 character text string (Numbers can handle numbers to a precision of only 15 places). Provided all 17 digits are present, sorting should be the same as for numerical values—the leftmost character is the most significant.
As a text string, your 'number' is sorted/evaluated alphabetically. A 'close match' accepts the 'largest value that is less than or equal to the search value'.
If your search term is 000200000 (a 9 character string), several 'wrong' answers will fit the 'close match' criteria, including all of those listed below:
000200000 (the 'correct' match)
0000xxxxx (x may be any of the three acceptable values)
0001xxxxx (x may be any of the three acceptable values)
The main problem here is that digits in a number (or characters in a text string) have decreasing significance related to their distance from the beginning of the string/number. You want a search in which each character has the same significance as each of the others when compared to the search key. To do that, you need to compare each character in the search string with the character in the same position in the similar string for each type of Pokemon, then take a count of the matches or a sum of the differences.
Here's one approach:
Column A contains labels.
Column B, the 17 digit search term, created in whatever manner you wish, and the similar 17 digit string for each of the characters.
Columns C through S contains a formula that detines, using subtraction, the difference between each digit of the search term and the corresponding digit of each character's profile.
Column C uses SUM() to calculate the total of columns C to S for each row.
T1 uses =MIN(T) to calculate "least different" profile.
Column A is a Header column; Row 1 is a Header row.
Formulas:
C2, and filled right to S2, then down to the last row of data:
=ABS(MID($B$1,COLUMN()-2,1)-MID($B2,COLUMN()-2,1))
T1: =MIN(T)
T2, and filled down column T: =SUM(C2:S2)
The conditional formatting rule set for all body cells in column T is shown below the table.
This may be enough to get you started. Formulas can be tweaked to produce results more closely matching what you're looking for, if necessary.
Regards,
Barry -
Urgent - Report Column based on LOV - Value not found in LOV
Hi All,
Recently, we have upgraded to HTMLDB 2.0 from HTMLDB 1.5.
I have a SQL report. One of the columns is based upon LOV - Display as Text (Based on LOV, does not save state).
For the "Ids" of the report, it should display the corresponding "Names" from the LOV.
But, for the cases, where no record exist in LOV for some Id, then it is directly showing the Id instead of "-" (which i have specified in Display Null Text) in the report column attributes.
Before upgrade, it was working fine.
Any idea where is the issue.
Please help.
Thanks in advance,
MonikaHi,
Can anybody help me in sorting out this issue please.
For your reference, i have made a test case on
http://apex.oracle.com/pls/otn/f?p=20451:4:3519837362944582:::::
Here, there are 2 tables
1. MY_EMP_COUNTRY(emoid, empname, cntry_id)
2. MY_COUNTRY_LOOKUP(id, name,active)
LOV is created on table 2
select name d, id r
from my_country_lookup
where active = 'Y'
And, on the page a SQL report is created
select empname, cntry_id
from my_emp_country
where, cntry_id is based upon the LOV.
Since, in lookup table, cntry_id = 4 is set inactive, it is not picked up by the LOV and hence on the report instead of showing the NULL text it is showing the cntry_id (4).
The attributes of report column cntry id -
Named LOV = CNTRY_LOV
Display Null = YES
NULL text = -
Display Extra Value = YES
Am I missing anything.
thanks,
Monika -
Need SQL to update Column based on latest value
EFF_DTE EXCH_FROM_CTRY_CD EXCH_TO_CTRY_CD SECTY_LST_PRCE SECTY_MTH_AVG_PRCE New Col In View
1/1/2013 USD MXN 12.988 12.988 12.88672
1/2/2013 USD MXN 12.988 12.988 12.88672
1/3/2013 USD MXN 12.9658 12.9806 12.88672
1/4/2013 USD MXN 12.7488 12.92265 12.88672
1/5/2013 USD MXN 12.743 12.88672 12.88672
I have above table and I need to populate New Col using view. New Column value should be Latest date SECTY_MTH_AVG_PRCE . For example If today date is 1/5/2013 date New Col should populate value 12.88672 for all the records for that month only. So every day when new MTH AVG Rate come then it should populate latest value of Secty_MTH_AVG_PRCE to New Col.
The New Col should populate with latest Avg_Prc only for that month. If New Month Start then new col should now update all records value but It should update only for June month Only.
Please help me to make a view query. and let me know if any query?
Thanks in advance.Hi,
This sounds like a job for the analytic FIRST_VALUE function:
MERGE INTO table_x dst
USING (
SELECT eff_dte
, FIRST_VALUE (secty_mth_avg_price)
OVER (
PARTITION BY exch_from_ctry_cd, exch_to_ctry_cd -- Maybe
ORDER BY eff_dte DESC
) AS new_col
FROM table_x
WHERE eff_dte >= TRUNC (SYSDATE, 'MONTH')
AND eff_dte < ADD_MONTHS (TRUNC (SYSDATE, 'MONTH'), 1)
) src
ON ( dst.eff_dte = src.eff_dte
AND dst.exch_from_ctry_cd = src.exch_from_ctry_cd -- Maybe
AND dst.exch_to_ctry_cd = src.exch_to_ctry_cd -- Maybe
WHEN MATCHED THEN UPDATE
SET dst.new_col = src.new_col
;I'm just guessing at lots of things, because the question is so unclear.
Is there a view involved in this problem, as well as the table? What role, if any, do exch_from_ctry_cd and exch_to_ctry_cd play in this problem. When you say "June", do you mean "February"?
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data. Make sure that no column is the same for all rows in the sample data. (E.g., have a least 2 distinct values for exch_to_ctry_cd.)
If you're asking about a DML statement, such as UPDATE, the sample data will be the contents of the table(s) before the DML, and the results will be state of the changed table(s) when everything is finished.
Explain, using specific examples, how you get those results from that data.
Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
See the forum FAQ {message:id=9360002} -
Conditionally Formatting One Column Based On The Value of Another Column
I have the following requirement:
I have 2 columns in a report showing Actual Sales & Budget Sales each year. I am using a bar chart to show the different values for these 2 columns.
I need to conditionally format the column "Actual Sales" so that if it is less than the "Budget Sales" it will appear in red, and green if "Actual Sales" is greater than "Budget Sales." So in a nutshell,
CASE WHEN "Actual Sales" < "Budget Sales" THEN
RED
ELSE
GREEN
END
Thoughts anyone?CASE WHEN (COL1 - COL2) < 0 then Red else Green end
regards
John
http://obiee101.blogspot.com
Maybe you are looking for
-
I put photos in trash and emptied it! Can I get files bacK?
I threw my entire photo library in trash (don't ask) and emptied it. I've been trying to recover files with Data Rescue II -- have run it three times and every time, it sticks when I get to "Scanning Drive, Postprocessing CBR Data" The first time it
-
Sharepoint 2013 and ADFS 3.0 Multi-Tenancy Problems
Hi I am hoping someone might be able to help with my scenario. Architectural Overview: We have a 3-Tier Sharepoint 2013 deployed. In this infrastructure we have the following Servers (1x ADFS server, 1x TMG Proxy for External Access, 2x Web Front-En
-
Hi everyone, Our SRM Production client is copied to SRM Test client.. Now i need to make the test client's configuration again ( integration with r3 , material replication , vendor replication... ) But in the test client, all master data is the same
-
Dear All, I have a cube in which I have derived fiscal period, fiscal year from Billing date. I have two queries on that cube one is based on fiscal period and other one is based on billing date. Both queries were running fine. From last few day
-
Time Config and Metric Refreshes
Post Author: owen CA Forum: Performance Management and Dashboards I have a daily calendar setup for the finnacial year 01/04/08 to 31/03/09 set up in Time Config. When setting up my metrics i selected the option to stop at current period, which only