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 PM
I didnt get u...
plz post with code and proper information...
Similar Messages
-
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 -
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 -
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 -
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 -
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 -
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 -
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! -
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 -
Populating column based on source value
Hi,
I have a following requirement :
Source table has one column type (values can be- type1 or type2)
target table has 2 columns - type1 and type2.
If the source table has following values then the transformation should be like the following
source table
type
type1
type2
type2
target table
Type1 Type2
Yes No
No Yes
No Yes
Thanks,
IsHi Andy,
How are u ?
Please try this ...
In taget column mapping :-
for column TrgColType1 -> case when srcCol = 'type1' Then 'YES' else 'NO'
for column TrgColType2 -> case when srcCol = 'type2' Then 'YES' else 'NO'
Regards,
Rathish -
Calculated column based on the value of a prompt
Hi all
I created a page prompt for the user than he can choose the years period: for example Year: between 2009 and 2015
In the report I have one of the measures that and I only want to display for the year 2009.I don't want to sum from 2009 till 2015
currently It calculating the sum from 2009 till 2015 and I only want it for the begining year of the period that the user selects in the prompt
How can I do that??
Regardstry to de-attach the prompt from your SA i.e. once you choose a column month to be in the prompt edit the formula and enter e.g. 'Start month'; then select the same column again and edit the formula and enter e.g. 'End month'; for each of the columns set the operator to equal; add presentation variables for both columns; then in the report use these variables in the filter for the remaining measures and for the one in question use the filter using; see if this would work
-
SSRS 2012
Dataset (40 columns) including the first 3 rows for Report layout configuration (eg: the <second> row specifies the column background color).
Starting from the 4th row, the dataset contains data to be displayed.
I would like to change the background color of the ColumnHeader/Column based on the value in the same column in the <second> row.
How can I accomplish the this requirement? (this must be applied for all the columns)
ThanksHi Fasttrck2,
Per my understanding that you want to specify the background color of all the columns/column header based on the value in one special column of the special row, right?
I have tested on my local environment and you can add expression to condition show the background color in the columns properties or the column header properties.
Details information below for your reference:
Specify the background color in the Column header: you can select the entire column header row and in the properties add expression in the Background color :
If you want to specify the background color for the entire column, you can select the entire column and add the expression, repeat to add background color for other columns.
If you want to specify the background color based on the value in the specific columns and row, you can create an hidden parameter to get the list of values from the specific column, specify the Available values and default values by select "Get
values from a query", finally using the expression as below to get the specific value you want:
Expression(Backgroud Color):
=IIF(Parameters!Para.Value(1)="1221","red","yellow")
If your problem still exists, please try to provide some smaple data of the report and also the snapshot of the report structure to help us more effective to provide an solution.
Any problem, please feel free to ask.
Regards
Vicky Liu
If you have any feedback on our support, please click
here.
Vicky Liu
TechNet Community Support
Maybe you are looking for
-
Acrobat Pro 8.1 stalls in Firefox .....frequently
I appear to have a problem with Acrobat Pro 8.1.6 downloading .pdf files in Firefox 3.0.14. This is happening frequently on files greater than about 2 MB. I am currently trying to download a reference manual that is 7.7MB. All was normal until abo
-
N95 overheating????
i am having trouble with my n95 v21.0.016 whenever i use an application which is processer heavy (music player , camera but mainly the web browser on sites that are pic heavy)the phone crashes and tries to re-boot, it used to do it first time or i'd
-
Function Module to get Reserved qty field in MMBE transaction
Hi Frds, In my report i need to get a reserved qty from mmbe tcode.., tables or Function Module . Pls help me
-
How to generate graph's in portal based on customer data
Hi customer wants graphs based on BW data in the portal.is it possible to generate graph's in BW and display it in portal? Prasad
-
Standby/Sleep System and Display Problems
Hi all, Installed 4 times WIndows 7 Ultimate x64 besides Max OSX Snow Leopard And have de folowing problems - Manual sleep works - Manual hibernation works - Manual start screensaver works - Automatic after a couple of miniutes: Screensaver will not