Highligting rows based on multiple conditions
Hi,
I have to show a report with exceptions highlighted in RED color. Exceptions are based on some conditions:
If I have four columns in an answer request, two of which say "Level" and "Status".
based on the "Level" and "Status" column conditions I have to highlight entire row which satisfies any of the condition.
Ex: If I have Level=3,4,5 and Status= Y,N then for
Level=3 or Status=N is one exception.
Level=4,5 or Status=Y is another exception.
Based on this two column conditions I have to highlight entire row in the report.
Can we do this in OBIEE. Highlighting rows based on multiple conditions?
Thanks in advance!
Thanks for the reply.
I have tried that already. I can highlight one specific field but not entire row.
If I keep on applying the conditional format for the other columns too then I can't apply the conditions.
Anyways, I have created a dummy column with the conditions in it and then applied that to the other fields and used conditional format to highlight the color.
Similar Messages
-
Advance Aggregation based on multiple conditions
Hi members,
I have a situation where I need to aggregate data based on multiple conditions. Relevant details of the problem is as follows.
There is a table (let's call X). It has following columns:
Transaction_Time (date)
Transaction_direction (Possible values IN or OUT)
Column_1
Column_2
Based on the columns: Transaction_direction, Column_1, Column_2, the type of the transaction will be derived. For example, if transaction_direction='IN' then transaction type is IN, if 'OUT' then transaction types are Out. Similarly if Column_1=Column_2 then transaction type is Txn_3 otherwise 4.
Based on date and transaction types the aggregation will happen.The sample output would be:
Time, Transaction type (IN, OUT, Txn_3, Txn_4), Sum of transactions
10-June-2013 00:00 IN Transactions 2500
10-June-2013 00:00 Txn_3 Transactions 3590
and so.
IN and Out transactions are easy to be derived using decode() function. However avoiding multiple UNION ALL and write a single SQL for all four conditions is tricky one.
Hope I clarified.
NeerajWhat version of Oracle are you using?
If you're on 11.x you can use the UNPIVOT feature as follows:
with t (Transaction_Time, Transaction_direction, Column_1, Column_2) as (
select date '2013-06-10', 'IN', 1, 1 from dual union all
select date '2013-06-10', 'IN', 2, 2 from dual union all
select date '2013-06-10', 'IN', 1, 2 from dual union all
select date '2013-06-10', 'IN', 3, 4 from dual union all
select date '2013-06-10', 'OUT', 3, 3 from dual union all
select date '2013-06-10', 'OUT', 3, 4 from dual
select * from (
select
transaction_time
, sum(case when transaction_direction = 'IN' then 1 end) as IN_count
, sum(case when transaction_direction = 'OUT' then 1 end) as OUT_count
, sum(case when Column_1 = Column_2 then 1 end) as Txn_3_count
, sum(case when Column_1 != Column_2 then 1 end) as Txn_4_count
from t
group by transaction_time
unpivot (
txn_count for transaction_type in (
IN_count as 'IN'
, OUT_count as 'OUT'
, Txn_3_count as 'Txn_3'
, Txn_4_count as 'Txn_4'
order by transaction_time, transaction_type
TRANSACTION_TIME TRANSACTION_TYPE TXN_COUNT
2013-06-10 IN 4
2013-06-10 OUT 2
2013-06-10 Txn_3 3
2013-06-10 Txn_4 3
If you're okay with getting one row per date with the 4 counts you can just use the inner select above, i.e.
select
transaction_time
, sum(case when transaction_direction = 'IN' then 1 end) as IN_count
, sum(case when transaction_direction = 'OUT' then 1 end) as OUT_count
, sum(case when Column_1 = Column_2 then 1 end) as Txn_3_count
, sum(case when Column_1 != Column_2 then 1 end) as Txn_4_count
from t
group by transaction_time
order by transaction_time
TRANSACTION_TIME IN_COUNT OUT_COUNT TXN_3_COUNT TXN_4_COUNT
2013-06-10 4 2 3 3
If you want to sum transaction amounts then use the same logic, except in the case statements replace 1 with the column you want to sum.
Regards,
Bob -
JDBC to IDOC Scenario - select data in jdbc based on multiple conditions
Hello
I have a JDBC to IDOC Scenario. I have to select the records in JDBC based on different conditions each time. For example I have to select based on company code '1000' and Employee claasification 'E1' and date range. After I post these records in SAP again I want to select other records for some other company code '2000' and different business area and different dates. Basically I want to extract data multiple times based on different conditions.
Hiow do I achieve this?
Another question is in the JDBC to IDOC scenario since the sender adapter is JDBC and the sender adapter polls depending on the duration of time ( say 60 secs ) in the adapter once after I extract the data based on a condition how do I control in such a way that the same data is not extracted again.
Thanks
NagaHi Naga,
I have to select the records in JDBC based on different conditions each time. For example I have to select based on company code '1000' and Employee claasification 'E1' and date range. After I post these records in SAP again I want to select other records for some other company code '2000' and different business area and different dates. Basically I want to extract data multiple times based on different conditions.
-->
Such requirements cant be handle through select query of the sender...but you can handle this in the message mapping area.....you can fire a select query in the database to pick up records in a batch of 10K (do not keep any condition on this except for sorting). After the records come into PI you can send the message to your target based on the unique combination of "Company code+ Employee clasification + date range" handling this in the message mapping.
Another question is in the JDBC to IDOC scenario since the sender adapter is JDBC and the sender adapter polls depending on the duration of time ( say 60 secs ) in the adapter once after I extract the data based on a condition how do I control in such a way that the same data is not extracted again.
You can use the N--> C logic
The data records that you pick have a corresponding control table i assume. There should be a field STATUS where the initial status of record should be N.
After you pick the records this status should be made C so that only those records present in the database with status = N are picked up.
Mention the condition Status = N in the select query.
Thanks
Dhwani -
Trying to alter font on a report row based on data condition
Hello.
I have an Apex application with a "classic" SQL report and a corresponding form.
In the report region I am pulling all items from a table (Select * from TASKS)
The TASKS table contains many columns including DUE_DATE and COMPLETE_DATE field.
I am trying to find a way to format the rows in my report based on the condition of those two fields.
If the record has a complete_date (not null) then I want to change the font for the entire row (each column) to be grey.
If the record does not have a complete_date (null) and due_date is before today, I want the row to be bold and red.
Otherwise, the row would display standard black text.
I can't seem to find a straightforward way to do this in Apex.Hi JodyMorin,
Try looking at this post:
Conditional item formatting (color)
You will need to tweak the code a bit for your needs, but I hope it helps.
-Marc -
Coloring individual table rows based on a condition
Hi Experts,
I have a table bound to a node in the context via datasource property.
I was trying to color an individual row based on a certain value in the context node.
Can anyone help my achieve this please?
For example:
for( int i=0; i<table.size(); i++)
if(wdContext.tableNode().getTableElementAt(i).getFieldA().equals("Y"))
// then color the table row
Any suggestions?
MSolved.
-
hi ,
i need help on the below scenario ,
we have a web dynpro table with different columns, now based on new business requirement one of the column need to
dynamically editable or non editable for different row.
for ex :
Field 1
Field 2 ( Dynamic field )
Field 3
Field 4
Data 11
Data 12 ( Editable with Drop down )
data 13
data 14
Data 21
Data 22 ( Non editable )
Data 23
data 24
Data 31
data 32 ( Editable with drop down )
data 33
data 34
how to achieve this ? please help on this.
Thanks in advance
Thanks
ManishManish,
there is no proper way to insert two Cell Editors in a column(except variants), have a look on below scenario, it may help.
add one more attribute to your table context node for read-only.
create dropDown as celleditor for table and bind with newly created attribute to read-only property of dropdown.
before binding data to table, check the condition then mention readonly value abap_true / false.
@ we can achieve by the use of Variants.
for ex :
Data 11
Data 12 ( Editable with Drop down)
data 13
read-only - abap_false
Data 21
Data 22 ( Non editable, dropdown )
Data 23
read-only - abap_true
Data 31
data 32 ( Editable with drop down )
data 33
read-only - abap_false -
Suppressing rows based on a condition
I have report, where I have to remove certain rows out of the report, based on the certain condition.
Note that, there are two characteristics in the rows, and one key figure in the columns. If the first characteristic value equals that of the second characteristic in the rows, I want to remove that row from display.
Row1 R1 R2 K1
Row2 R3 R3 K1
Row3 R2 R3 K1
Row4 R3 R2 K1
In the above example, I need to remove Row2, because both characteristics have same value, which is R3. I want to suppress those records, and just show Row1, Row3 and Row4.
Row1 R1 R2 K1
Row2 R3 R3 K1 -> remove this row
Row3 R2 R3 K1
Row4 R3 R2 K1
My problem is conditions only work on the key figures, not characteristics. I tried the replacement variables, but it is not working.
Any ideas?Hi,
You can achieve the solution if your 2 characteristic's data type is NUMC.
If it is NUMC, then try the below steps:
1. Create a formula in the Key Figures structure.
2. In the formula, create a formula variable, and on the formula variable select the processing type as Replacement Path. After that choose the first characteristic on the Characteristics selection.
3. Repeat step 2 again for second characteristic.
4. Now the two formula variables contains two characteristic. Select both of them and subtract it.
5. You will get the values 0 and not equel to 0.
6. Create a condition and suppress zero values of the formula key figure.
If it is not NUMC, then i guess you have to stage the data to another location. At the time of transformation you have to supress the records.
Vivek -
Triggering BW Process Chain based on multiple conditions/events
Hi all,
We are facing a situation where we need to execute a BW process chain only if another process chain and two different R/3 jobs are completed.
Could anyone give any inputs as to how to include multiple start conditions for a BW process chain.
Thanks,
Sarathwe did the following for the same challenge :
create a z table with a description field and a date field.
eg
job_1 20100829
job_2 20100829
job_3 20100829
create one program that reads this table and inserts for every job an entry.
if you already have two other entries in the table, this means the other two jobs have also finished to you can trigger the chain (check the forum on how to trigger a chain using abap).
if you don't have the entries in the table insert the entry for this job.
create one event (event_1) to trigger this program.
at the end of the R/3 job/process chain raise event_1 in BW. -
SSIS + split 1 row in multiple rows based on multiple columns
Hi all,
I have a flat file
Shop ID Check 1 Check 2 Check 3
500 OK
OK NOK
I want to transform this to staging as 3 rows
Shop ID Check number
Result
500 1
OK
500 2
OK
500 3
NOK
Anyone can tell me how to tackle this?I basically have a table that has the columns I specified
Shop Check 1
Check 2 Check 3
500 OK
OK NOK
I now want to actually have them loaded in another table where I have multiple rows for each shop.
Shop Check
Result
500
1 ok
500 2
ok
500 3
nok
So basically I want to go from a column view to a row view. Is this possible?
In other words, I do see multiple rows for each shop ID which is awesome! But I would like to have instead of the result that number of the check. (1,2,3) with the result next to it :)
500 OK
500 OK
500 NOK -
Finding the most current row where it the row meets all multiple conditions
Need to find the latest barcode to check if it is expired previous to today. Currently getting barcode that has expired but that happened after the stateID changed to 2 not earlier when the stateID is 1 and it needs to be
the current record by date. The expired is done by a scalar function that uses the barcode that calculates an expired container. The expired container from the cte is either 1 for expired or 0 for non expired containers
from the containerHistory table
stateID barCode dateEntered
1 901178-2240 2014-11-15 10:34:09.693
2 901178-2240 2014-11-19 22:07:45.0230
From the cte table
stateID dateEntered barcode containerExpired
1 2014-11-19 22:07:45.000 901178-2240 1
From the global ##Temp table
2 2014-11-19 22:07:45.000 901178-2240
;with cte AS(
SELECT stateID, barcode, dateEntered, containerExpired
FROM barcode.dbo.ContainerHistory
WHERE dateEntered >= DATEADD(DAY, DATEDIFF(DAY, 0, CURRENT_TIMESTAMP) -7, 0)
AND dateEntered < DATEADD(DAY, DATEDIFF(DAY, 0, CURRENT_TIMESTAMP), 0)
AND stateID = 1 AND containerExpired = 1
SELECT stateID, barcode, dateEntered, containerExpired
INTO ##Temp
FROM
(SELECT barcode, stateID, dateEntered, containerExpired, row_number() over(partition by barcode, containerExpired order by dateEntered) seq
FROM cte
WHERE dateEntered <= (select max(dateEntered) from cte where containerExpired = 1 AND stateID = 1) AND containerExpired = 1
) d
WHERE seq = 1 ORDER BY dateEntered
SELECT * FROM ##Temp ORDER BY barcode
SELECT barcode, stateID, dateEntered WHERE containerID IN (SELECT barCode AS containerID FROM ##Temp) ORDER BY containerID, dateEntered
DROP TABLE ##TempYouir approach is wrong. To track the history of, say, Foobars we need to see time as a continuum and model it as (begin_date, end_date) pairs that define when a foobar had a particular value. Here is the skeleton.
CREATE TABLE Foobar_History
(foo_id CHAR(9) NOT NULL,
start_date DATE NOT NULL,
end_date DATE, --null means current
CHECK (start_date <= end_date),
foo_status INTEGER NOT NULL,
PRIMARY KEY (foo_id, start_date));
When the end_date is NULL, that state of being is still current. You use a simple query for the status on any particular date;
SELECT *
FROM Foobar
WHERE @in_cal_date
BETWEEN start_date
AND COALESCE (end_date, CURRENT_TIMESTAMP);
There are more tricks in the DDL to prevent gaps, etc
CREATE TABLE Events
(event_id CHAR(10) NOT NULL,
previous_event_end_date DATE NOT NULL
CONSTRAINT Chained_Dates
REFERENCES Events (event_end_date),
event_start_date DATE NOT NULL,
event_end_date DATE UNIQUE, -- null means event in progress
PRIMARY KEY (event_id, event_start_date),
CONSTRAINT Event_Order_Valid
CHECK (event_start_date <= event_end_date),
CONSTRAINT Chained_Dates
CHECK (DATEADD(DAY, 1, previous_event_end_date) = event_start_date)
-- CHECK (previous_event_end_date + INTERVAL '01' DAYS) = event_start_date)
-- disable the Chained_Dates constraint
ALTER TABLE Events NOCHECK CONSTRAINT Chained_Dates;
GO
-- insert a starter row
INSERT INTO Events(event_id, previous_event_end_date, event_start_date, event_end_date)
VALUES ('Foo Fest', '2010-01-01', '2010-01-02', '2010-01-05');
GO
-- enable the constraint in the table
ALTER TABLE Events CHECK CONSTRAINT Chained_Dates;
GO
-- this works
INSERT INTO Events(event_id, previous_event_end_date, event_start_date, event_end_date)
VALUES ('Glob Week', '2010-01-05', '2010-01-06', '2010-01-10');
-- this fails
INSERT INTO Events(event_id, previous_event_end_date, event_start_date, event_end_date)
VALUES ('Snoob', '2010-01-09', '2010-01-11', '2010-01-15');
--CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
in Sets / Trees and Hierarchies in SQL -
Filter rows based on Where condition AND-OR ?
Hi,
I have table "Table1" and columns are
Id
AddendumNo
ClaimNo
Description
1
A1
C1
D1
2
A1
C1
D2
3
A1
C2
D1
4
A2
C3
D3
5
A2
C1
D2
I have three controls in the UI.
If I give txtA1.Text =”A1” only then should be return Id- 1,2,3 records.
If I give txtC1.Text =”C1” only then should be return Id- 1,2,5 records.
If I give txtA1.Text =”A1” AND txtC1.Text =”C1” then should be return Id- 1,2 records.
If I give give txtA1.Text =”A1” AND txtC1.Text =”C1” AND txtD1.Text=”D1” then should be return Id-1 record.
Please help me to write dynamic sql query ?
Thank you.HI
Try following code
CREATE PROC usp_dynamic_exec @where VARCHAR(Max)
AS
BEGIN
DECLARE @strQ AS NVARCHAR(max)
SET @strQ = 'Select * from yourTableName'
IF ISNULL(@where, '') <> ''
BEGIN
SET @strQ = @strQ + ' Where ' + @where -- where clause
END
EXECUTE sp_executesql @strQ
END
GO
Ref :http://technet.microsoft.com/en-us/library/ms188001.aspx
http://www.vishalseth.com/post/2008/07/10/Dynamic-SQL-sp_executesql.aspx
http://blog.sqlauthority.com/2013/03/28/sql-server-executing-dynamic-sql-sql-queries-2012-joes-2-pros-volume-4-query-programming-objects-for-sql-server-2012/
Mark as Answer if you find it useful
Shridhar J Joshi Thanks a lot -
Deleting data from another table with multiple conditions
Hi frnds
I need to delete some data from a table based on multiple condition I tried following sql but its deleteing some rows which is not meeting the criteria which is really dangerours. When i trying = operator it returns ORa- 01427 single -row subquery returns more than one row
delete from GL_TXNS
where TRN_DT in (Select trn_Dt from GL_MAT)
and BR in (select ac_branch from GL_MAT)
and CODE in (select CODE T from GL_MAT)
and (lcy_amt in (select lcy_amt from GL_MAT) or
fcy_amt in(select fcy_amt from GL_MAT)
rgds
ramyaMy answer is the same as Avinash's but I will explain a little bit more.
ORa- 01427 single -row subquery returns more than one rowmeans that you have a subquery that Oracle is expecting one value from that is returning multiple values. In your case you need one value for the equijoin ("=") and you are getting more than one value back. The error happens even if all the values are the same - multiple values being returned will cause the error.
The solution is to either allow multiple values to be returned (say, use the IN condition istead of "=") or only return one value if possible (say, forcing one value by using DISTINCT, GROUP BY, or a WHERE clause condition of ROWNUM=1) - but these workarounds must be checked carefully to make sure they work correctkly -
Multiple Condition Calculation - New to Numbers
I am new to numbers and/or excel but what Im trying to do ended up being a lot harder than I thought it should be.
Im trying to create a summary of items based on multiple conditions
_ID TYPE # DATE_
a000001 1 5 Jan 1, 2008
b000002 7 2 Jan 2, 2008
a000001 7 1 Jan 3, 2008
a000001 1 6 Jan 4, 2008
b000002 1 32 Jan 5, 2008
c000003 7 6 Jan 6, 2008
c000003 1 6 Jan 7, 2008
If ((ID == a000001) AND (TYPE == 1)) then add the # column to the current total.
OR
If ((ID == a000001) AND (TYPE == 1) AND (DATE == Jan 1, 2008)) then add the # column to the current total.
Does that make sense? Ive found may versions of conditional on this forum but I cant find any with running totals.
Thanks all!
nullBo,
I'm going to give you a method that you can massage to your liking.
The E-column may be hidden, and will contain your condition logic. Now E2 contains:
=AND(A2="a000001", B2=1)
Column A2 of the Formula Table contains:
=SUMIF(DataTable :: E, TRUE, DataTable :: C)
The first argument is the test range, your logic, the second argument is the valid condition for the test range, and the third argument is the range to be summed.
Jerry -
SALV - Hide rows based on certain condtion
All,
I have searched a lot in this forum this answer, but could not find any nearest one.
I am using CL_SALV_TABLE (SALV) for an ALV report. I wanted to hide some rows based on some condition say for example
in the ALV one of the column is MATNR say i wanted to hide rows that having MATNR less than 1000.
How we can do this ?
Thanks
a®Good day, everyone!
Ive faced the same issue - I either have to hide a row or to change subtotal line manually.
Have anyone solved this already?
PPShinde wrote:
HI!
> I think u first calculate total in internal table. save that totals into some veriable and then remove those lines which u dont want to show from internal table and then calculated total append into that internal table .
> I thinks it will work!
> all the best!
I can't find anything that looks like a table for subtotals - they are counting somewhere inside SALV.
Or, maybe, you know something that I dont?
Clemens Li wrote:
If people insist on the requirement, disable SUM and create your own total line.
Add my own total line? How can I do this? -
Table Control - Input Enabling/Diabling of Rows based on Condition.
Hi,
In the TC, I want to Input Enable/Disable the rows based on Conditions. The First row is input enabled always. But the other rows, (2nd onwards) need to be Input Enabled/Disabled based on some conditions. It is possible to make this working. Can you please provide me a suitable solution for this?
Appreciate Your Help.
Thanks,
KannanHi Kannan...
If we are talking about "Rows"...
then identify based on some conditions the row numbers and in PBO...loop at screen with screen name..set thier input properties and modify screen (make them input only)
If we are taking into consideration "columns"
There is an internal structure COLS where we can identify column number of screen name ...or we can take except for one particular column..
if some condition satisfied....
loop at screen where screen-name <> "Column which is input'.
Loop at screen...and make other columns display only.
modify screen
endif.
Regards
Byju
Maybe you are looking for
-
NCS Licensing in High Availability
We are transitioning from a single WCS to NCS, and are looking at high-availability and the costs associated with it. How does the licensing work if you want a NCS high availability environment? If you have a 10,000 device license on your primary, d
-
Export Function Group or Funtion Module
Dear all, I'm new in ABAP development. I had a set of function module inside the same function group and i want to test it in another sandbox system. Since, there is no transport routing between the development and sandbox server. Is there any f
-
How is the db connection used... and how to use the queries
dear sir, i have to important question. i am pasting the code of a jsp file below.... please look in to this... in this page.. how is he making a database connection... and in this page where are the select statements and queries.... i have tried man
-
Help please- Lion wont recognise Nikon RAW files [nef]
Hello all, posted this issue on a number of forums to no avail - basically been using my iMac with Lightroom to download and process photos from my Nikon D300s and D90 for over a year - then I upgrade to Lion and it all stops [no other changes]. Now
-
A105-S4344 Satellite recovery help needed
A short rundown on my situation... I have AVG virus protection and run scans at least 3 times a week. Unfortunately, some nasty malware got loaded from the web and I couldn't get rid of it. As soon as I downloaded the free Adaware program, I lost alm