BO: separate column for + - sign apart from column with value
Hello
In Business Objects Web Intelligence I would like to create a column that shows the sign '+' or '-' when a key figure KF1 is below 0 or above. How do I do this? It has to be a separate column. I already created a calculated key figure KF2 that has as formula ABS (KF1). KF1 itself must not be shown as contains amount and sign in one field. I need to separate these 2.
Regards
Arjan
You can create one more variable with the formula:
=If([Key FIG 1]<0) Then "-" Else "+"
Regards,
Rohit
Similar Messages
-
I have read 118 files from a directory using the list.vi. Each file has 2 cols with 2088rows. Now I have the data in a 2 D array with 2cols and 246384rows (118files * 2088rows). However I want to put each file in the same array but each file in separate columns. then I would have 236 columns (2cols for each of the 118 files) by 2088 rows. thank you very much in advance.
Hiya,
here's a couple of .vi's that might help out. I've taken a minimum manipulation approach by using replace array subset, and I'm not bothering to strip out the 1D array before inserting it. Instead I flip the array of filenames, and from this fill in the end 2-D array from the right, overwriting the column that will eventually become the "X" data values (same for each file) and appear on the right.
The second .vi is a sub.vi I posted elsewhere on the discussion group to get the number of lines in a file. If you're sure that you know the number of data points is always going to be 2088, then replace this sub vi with a constant to speed up the program. (by about 2 seconds!)
I've also updated the .vi to work as a sub.vi if you wa
nt it to, complete with error handling.
Hope this helps.
S.
// it takes almost no time to rate an answer
Attachments:
read_files_updated.vi 81 KB
Num_Lines_in_File.vi 62 KB -
Hello, I hope someone can help me.
I pre-ordered Justin Timberlake's new album and have tried to download the album today, however for some reason "Suit & Tie" is listed as unpurchased and will charge me 99p to download?
All the other tracks have downloaded fine apart from this one.
A couple of things I should mention in case they affect this issue:
I am trying to download it directly to my iPhone - I have not loaded up iTunes on my PC as of yet.
I already have the song "Suit & Tie" as a single.
Will iTunes realise I technically already have the song so charge me less and just give me the remainder of the album?We are having this same issue. We have over 200 songs that are now missing and only our most recent ones show up in our ITunes library. Fortunately we have one phone that still has all of our music still in tact. This phone is no longer one I will be using as I upgraded to the Iphone 6, and only the most recent purchased songs remain. The rest are no where to be found and the iTunes store shows that I would need to re-purchase. Not sure what to do as when I tried to sync my last phone, all the songs were gone.
-
Column with values separted by commas
I have a column which brings back a series of numbers (as text) separated by commas e.g.
20145, 58896, 52369, 88745
I want to search this column and identify when there is a certain combination of these 5 digit numbers e.g.
if columncontents equal any of (12345,23445,34567) AND columncontents equal any of (88965,63258,36894) then say hi (or whatever)
Envisioning a formula in a separate column which evaluates the contents of the column in question and then turns RED or I insert some text.
Thank you so much!The suitable formula should be like this
=(Match([Column];"12345") or Match([Country];"23445") or Match([Country];"34567") )
the above formula returns a TRUE for a match found. and a false other wise. then use alerters on the column to make it red or what ever.
Thanks,
Karthik -
UPDATE value in column with value in SAME TABLE
Hi all,
Here's my issue...
I have a table which records all incidents for a person.
The table looks something like this:
tbl_connect(person_Id NUMBer,
OLD_ID VARCHAR2(24),
CASE_NUMBER VARCHAR2(10),
CASE_TYPE VARCHAR2(10),
PERSON_ROLE VARCHAR2(30),
INCIDENT_TYPE VARCHAR2(40));
The table is populated from a source table with all fields except person_id. Person_id is a sequence number that gets generated if the person comitting the incident is a NEW PERSON to our system. OLD_Id is the unique identifier between the source table and tbl_connect to identify a person.
The problem: If an existing person commits a new incident, a new record will be inserted into tbl_connect without PERSON_ID. Since the person already is in the database the person_id already exists in tbl_connect for that person. I now need to UPDATE person_id column with the person_id that already exists for this person. How can i achieve this.
Ive been trying all sorts of update queries but nothing seems to work. ANy help will be appreciated. Thanks in advance.Frank,
Thanks for the speedy reply. Here is a sample table.
I know it's a bit confusing. The data that is being dumped into this table is information from a old system. The OLD_ID is in here because it is the relationship between this table and the old table. PERSON_ID is new to this system to identify a person uniquely. That is why i need them both in this table for right now.
So say my tbl_connect got populated with new info from the old table. As you can see, old_id=567A has comitted another incident. Since he already exists in tbl_connect, now i need to update person_id with the value of 1. Does that make sense now????? If old_id did not exist, all i would do is insert a new row and set person_id to the next sequence number.
TBL_CONNECT
PERSON_ID OLD_ID CASE_NUMBER CASE_TYPE
1 567A 12345 IR
1 567A 15236 MV
567A 98547 IR<--newly inserted record of same person -
Finding Updated Columns with Values in Rows
Hello,
I have a one requierment as below.
if I have Table ITEM with Below records
ParcelID
ItemCode
CurrentLocation
Destination
UpdatingTime
1010
GLS
ABC
XYZ
01-12-14
1015
PHM
SSS
ZZZ
01-12-14
If any of the column value is updated it will replicate to ITEMUPDATE table with old row and new row as well.
Suppose for ParcelID 1010 CurrentLocation Changed from ABC to CDE it will store in ITEMUPDATE table with both records
old and new and if ParcelID 1015 CurrentLocation Changed from SSS to KKK it will also store as below.
Now ITEMUPDATE table will have all records old as well as new rows as below.
ParcelID
ItemCode
CurrentLocation
Destination
UpdatingTime
1010
GLS
ABC
XYZ
01-12-14
1010
GLS
CDE
XYZ
02-12-14
1015
PHM
SSS
ZZZ
01-12-14
1015
PHM
KKK
ZZZ
01-12-14
Like this any column can update not only CurrentLocation.
Now the requirement is I want to know which columns is updated and what is the new value.
Some what results need to look like below.
ParcelID
Old_CurrentLocation
New_CurrentLocation
1010
ABC
CDE
1015
SSS
KKK
Please Anyone Can help me on this .
Thank You,
AvisHello Avis,
You need to store date and time in 'UpdatingTime' column in both ITEM and ITEMUPDATE tables.
If you store only date, you will not get desired results as there may be multiple records for a 'ParcelID' in the same date in ITEMUPDATE table. It is difficult to get the latest record from multiple records with same dates for a 'ParcelID' from ITEMUPDATE.
Alternatively you can create a surrogate key , like 'ItemUpdateID', in ITEMUPDATE from which we can get the latest record for a 'ParcelID'. The surrogate key can be a integer identity column so that automatically incremented and updated for each insert
in ITEMUPDATE. Then it is easy to get latest UpdatingTime for a ParcelID from ITEMUPDATE table.
If the table design and data is something as below:
ITEM table
ParcelID ItemCode CurrentLocation Destination UpdatingTime
1010 GLS ABC XYZ
2014-01-12
1011 MMX ABD XVB
2014-01-12
1015 PHM SSS ZZZ
2014-01-12
ITEMUPDATE table
ItemUpdateID ParcelID ItemCode CurrentLocation Destination UpdatingTime
1 1010 GLS
ABC XYZ 2014-01-12
2 1015 PHM SSS
ZZZ 2014-01-12
3 1015 PHM
KKK ZZZ 2014-02-12
4 1010 GLS
CDE XYZ 2014-02-12
5 1011 MMX
ABD YYY 2014-01-12
Here 'ItemUpdateID' is identity column.
The SELECT query can be written as below:
SELECT A.ParcelID, A.ItemCode,
B.CurrentLocation 'New_Location',
ISNULL((SELECT CurrentLocation FROM ItemUpdate WHERE ItemUpdateID = (SELECT MAX(D.ItemUpdateID)
FROM ItemUpdate D WHERE D.ItemUpdateID < B.ItemUpdateID AND D.ParcelID = B.ParcelID)), A.CurrentLocation) 'Old_Location'
FROM Item A
LEFT JOIN ItemUpdate B On B.ParcelID = A.ParcelID
AND B.ItemUpdateID = (SELECT MAX(ItemUpdateID) FROM ItemUpdate C WHERE C.ParcelID = B.ParcelID)
The result will be as follows:
ParcelID ItemCode New_Location Old_Location
1010 GLS CDE ABC
1011 MMX ABD ABD
1015 PHM KKK SSS -
Google bookmarks asks for sign in when working with opened email
After opening my Google email, I cannot access my Google bookmarks from the Google toolbar icon. It requests that I sign in. Please respond quickly as I have lost all my websites accessed by saving them in my Google bookmarks folders.
Google has changed the domain for signing in to accounts.google.com and the Google toolbar is still using the old and longer working www.google.com/accounts domain
You will have to update that domain yourself by editing a file used by the Google Toolbar.
*Go to the extension folder in the Firefox profile folder and find the folder with the Google Toolbar
*Open up lib\toolbar.js with a plain text editor
*Replace: www.google.com/accounts with accounts.google.com
You can also access the Google Bookmarks here:
* http://www.google.com/bookmarks -
Report for Storage location wise Stock with value..?
Hi guru's
Can anybody explain me what is T.code i want to use to get a report for STORAGE LOCATION STOCK with VALUE..?
Urgent reply me ..
Thanks
sap-mmSorry Mr chetan,
I want to see only the stock available in my company with Value and storage location wise..
Please try to get report for this
Thanks
sap-mm -
Filling a column with value from other columns
Hello all!
Suppose i have the following table:
TableA(col_one int, col_two int, result int);I want to insert value to col_one and col_two, and result will be filled with the multiplication product of col_one and col_two.
ok firstly i know this is very redundant way of storing data and generally should not be used, but one case when this might come in handy is when we want to store a total payment amount of product price and quantity. this can be useful since product price can change overtime and we need to record the data as the transaction happens to avoid change in total payment over time (as the price drops or rises).
now with the problem:
I tried this in mysql and it works:
INSERT INTO TableA (col_one, col_two, result) VALUES (30, 20, col_one * col_two);but not in oracle, which output the following error:
>
ora 00984 column not allowed here
any idea on how to do it in oracle?
thank you very much :)
ps, thank you for the fast replies on my previous topic.If the insert is done inside PL/SQL you can return the primary key for the row (assuming the table has a primary key?!?) and then update based on that key, but this still introduces two statements where a single statement can suffice.
Why are you thinking so complicated? ;-)
If it is done in PL/SQL the you can do this:
create procedure addRow(p_value1 number,p_value2 number) is
p_result number;
begin
p_result:=p_value1*p_value2;
insert into table1 (col_one,col_two,result) values(p_value1,p_value2,p_result);
commit;
end;If you want to do this automatically when someone inserts a row (without providing the result) you have to use an insert trigger.
Dim -
When we go for lsmw apart from call transaction and session method in bdc?
Hi Experts,
Hi,
Mostly LSMW is used where small data migartion is needed, wwhere as BDC for huge data migration.
LSMW is sometimes used by functional consulatants as they dont have any programming knowledge .
Revert back if any issues.
Reward with points if helpful.
Regards,
Naveen -
Audio works for everything apart from the itunes festival app
Audio works fine in menus, music and video. But when trying to watch concerts on the itunes festival app there is no audio, only video. Have tried changing settings and restarting apple tv but has made no difference. Seems very strange.
I called Apple and got this fixed. It was a simple "Restore" from the settings menu. Not the restart but restore the Apple TV back to factory settings, I went straight onto the featival channel and it worked (and has continued to work) perfectly.
Hope this helps everyone else! -
Generate xml using FOR XML PATH from table with hierarchy
I need to create xml from a table like:
EL1 EL2 EL3 Attr01 Attr02 Attr03 Attr04
E10, , ,a,b,c,d
E10,E1010, ,a,b,c,d
E10,E1010,E101010,a,b,c,d
E10,E1010,E101020,a,b,c,d
E10,E1010,E101030,a,b,c,d
E10,E1020, ,a,b,c,d
E10,E1020,E102010,a,b,c,d
E20, , ,a,b,c,d
E20,E2010, ,a,b,c,d
E20,E2010,E201010,a,b,c,d
E20,E2020, ,a,b,c,d
E20,E2020,E202010,a,b,c,d
E20,E2020,E202020,a,b,c,d
The hierarchy is EL1--EL2--EL3, and the 3 columns should be elements of xml;
The other for columns Attr01,Attr02,Attr03,Attr04 should be attributes of xml;
The actual table could have more than 500 rows(there are many values for El1,EL2,and EL3).
The expected xml should like:
<root>
<E10 Attr01="a" Attr02="b" Attr03="c" Attr04="d">
<E1010 Attr01="a" Attr02="b" Attr03="c" Attr04="d">
<E101010 Attr01="a" Attr02="b" Attr03="c" Attr04="d" />
<E101020 Attr01="a" Attr02="b" Attr03="c" Attr04="d" />
<E101030 Attr01="a" Attr02="b" Attr03="c" Attr04="d" />
</E1010>
<E1020 Attr01="a" Attr02="b" Attr03="c" Attr04="d">
<E102010 Attr01="a" Attr02="b" Attr03="c" Attr04="d" />
</E1020>
</E10>
<E20 Attr01="a" Attr02="b" Attr03="c" Attr04="d">
<E2010 Attr01="a" Attr02="b" Attr03="c" Attr04="d">
<E201010 Attr01="a" Attr02="b" Attr03="c" Attr04="d" />
</E2010>
<E2020 Attr01="a" Attr02="b" Attr03="c" Attr04="d">
<E202010 Attr01="a" Attr02="b" Attr03="c" Attr04="d" />
<E202020 Attr01="a" Attr02="b" Attr03="c" Attr04="d" />
</E2020>
</E20>
</root>
I create a sample Src table:
CREATE TABLE Src
EL1 VARCHAR(10),
EL2 VARCHAR(10),
EL3 VARCHAR(10),
Attr01 VARCHAR(10),
Attr02 VARCHAR(10),
Attr03 VARCHAR(10),
Attr04 VARCHAR(10)
GO
INSERT INTO Src
(EL1,EL2,EL3,Attr01,Attr02,Attr03,Attr04
SELECT 'E10','','','a','b','c','d'
UNION SELECT 'E10','E1010','','a','b','c','d'
UNION SELECT 'E10','E1010','E101010','a','b','c','d'
UNION SELECT 'E10','E1010','E101020','a','b','c','d'
UNION SELECT 'E10','E1010','E101030','a','b','c','d'
UNION SELECT 'E10','E1020','','a','b','c','d'
UNION SELECT 'E10','E1020','E102010','a','b','c','d'
UNION SELECT 'E20','','','a','b','c','d'
UNION SELECT 'E20','E2010','','a','b','c','d'
UNION SELECT 'E20','E2010','E201010','a','b','c','d'
UNION SELECT 'E20','E2020','','a','b','c','d'
UNION SELECT 'E20','E2020','E202010','a','b','c','d'
UNION SELECT 'E20','E2020','E202020','a','b','c','d'
GO
I tried to use FOR XML PATH to generate xml for the sample data. When the records increase to a few hundreds, it's not a good idea.
Here is my script:
SELECT
(SELECT Attr01 AS '@Attr01'
,Attr02 AS '@Attr02'
,Attr03 AS '@Attr03'
,Attr04 AS '@Attr04'
,( SELECT
Attr01 AS '@Attr01'
,Attr02 AS '@Attr02'
,Attr03 AS '@Attr03'
,Attr04 AS '@Attr04'
,( SELECT
Attr01 AS '@Attr01'
,Attr02 AS '@Attr02'
,Attr03 AS '@Attr03'
,Attr04 AS '@Attr04'
FROM Src
WHERE EL3 = 'E101010'
FOR XML PATH('E101010'),TYPE
) AS 'node()'
,( SELECT
Attr01 AS '@Attr01'
,Attr02 AS '@Attr02'
,Attr03 AS '@Attr03'
,Attr04 AS '@Attr04'
FROM Src
WHERE EL3 = 'E101020'
FOR XML PATH('E101020'),TYPE
) AS 'node()'
,( SELECT
Attr01 AS '@Attr01'
,Attr02 AS '@Attr02'
,Attr03 AS '@Attr03'
,Attr04 AS '@Attr04'
FROM Src
WHERE EL3 = 'E101030'
FOR XML PATH('E101030'),TYPE
) AS 'node()'
FROM Src
WHERE EL2 = 'E1010' AND (EL1 <>'' AND EL3 ='')
FOR XML PATH('E1010'),TYPE
) AS 'node()'--1010
,( SELECT
Attr01 AS '@Attr01'
,Attr02 AS '@Attr02'
,Attr03 AS '@Attr03'
,Attr04 AS '@Attr04'
,( SELECT
Attr01 AS '@Attr01'
,Attr02 AS '@Attr02'
,Attr03 AS '@Attr03'
,Attr04 AS '@Attr04'
FROM Src
WHERE EL3 = 'E102010'
FOR XML PATH('E102010'),TYPE
) AS 'node()'
FROM Src
WHERE EL2 = 'E1020' AND (EL1 <>'' AND EL3 ='')
FOR XML PATH('E1020'),TYPE
) AS 'node()'--1020
FROM Src
WHERE EL1 = 'E10' AND (EL2 ='' AND EL3 ='')
FOR XML PATH('E10'),TYPE) 'node()'
,(SELECT Attr01 AS '@Attr01'
,Attr02 AS '@Attr02'
,Attr03 AS '@Attr03'
,Attr04 AS '@Attr04'
,( SELECT
Attr01 AS '@Attr01'
,Attr02 AS '@Attr02'
,Attr03 AS '@Attr03'
,Attr04 AS '@Attr04'
,( SELECT
Attr01 AS '@Attr01'
,Attr02 AS '@Attr02'
,Attr03 AS '@Attr03'
,Attr04 AS '@Attr04'
FROM Src
WHERE EL3 = 'E201010'
FOR XML PATH('E201010'),TYPE
) AS 'node()'
FROM Src
WHERE EL2 = 'E2010' AND (EL1 <>'' AND EL3 ='')
FOR XML PATH('E2010'),TYPE
) AS 'node()'--2010
,( SELECT
Attr01 AS '@Attr01'
,Attr02 AS '@Attr02'
,Attr03 AS '@Attr03'
,Attr04 AS '@Attr04'
,( SELECT
Attr01 AS '@Attr01'
,Attr02 AS '@Attr02'
,Attr03 AS '@Attr03'
,Attr04 AS '@Attr04'
FROM Src
WHERE EL3 = 'E202010'
FOR XML PATH('E202010'),TYPE
) AS 'node()'
,( SELECT
Attr01 AS '@Attr01'
,Attr02 AS '@Attr02'
,Attr03 AS '@Attr03'
,Attr04 AS '@Attr04'
FROM Src
WHERE EL3 = 'E202020'
FOR XML PATH('E202020'),TYPE
) AS 'node()'
FROM Src
WHERE EL2 = 'E2020' AND (EL1 <>'' AND EL3 ='')
FOR XML PATH('E2020'),TYPE
FROM Src
WHERE EL1 = 'E20' AND (EL2 ='' AND EL3 ='')
FOR XML PATH('E20'),TYPE) AS 'node()'
FOR XML PATH(''),ROOT('root')
If I get a few hundreds of rows, how huge the script should be. Does anyone have better solution for this? Thanks.
TaowBob,
Thanks! And sorry for late feedback.
The XSD requires the xml structures like the following
<Schools>
<School01>Some school</School01>
<School02>Some other school</School02>
</Schools>
I have to use the number in the element name.
Right now I just use the nested FOR XML PATH, although I have to write thousand lines code.
Thanks anyway.
Tao
Tao -
Dynamic update of column with values derived by formula on other table.
i have 3 tables; table A,B and C
table A has two columns (id and Quantity), based on the id value, the quantity value is computed using a formula on two rows (one from table B and the other from C).
the formula is different for each id value.
but after every month the quantity value has to be updated (because tables B & C get updated monthly).
example. given id=1, quantity= select round((sum(h.col1)/sum(p.col1), 2) from B p, C h
given id=2, quantity=select round((sum(col1)/sum(col3)), 2) from C
so for every id the quantity is derived by a different formula, but the quantity value has to be recomputed every month.
need help.1. update table a
quantity = decode (id,1, <formul1>, id,2 , formula 2...)
2. if you wanto schedule this as monthly task
use dbms_job.submit
send the above query to "What" parameter. -
Update A Column with value of Column in the next Row
Hi All,
I have a table which is like this
ID NUMBER,
SUB_ID NUMBER,
STARTDATE DATE.
The Value is say for example like this:
ID SUB_ID StartDate
1 1 1-JAN-09
1 2 20-FEB-09
1 3 1-MAR-09
2 1 10-JAN-09
2 4 10-APR-09
2 3 1-MAR-09
2 2 2-FEB-09
I have to add a new column END DATE in the table and populate a value which is One Day less than the value of
start Date for next row. I have to order by ID and SubID and so that colum looks like this.
ID SUB_ID StartDate END DATE
1 1 1-JAN-09 19-FEB-09
1 2 20-FEB-09 28-FEB-09
1 3 1-MAR-09 DEFAULT-END DATE
2 1 10-JAN-09 1-FEB-09
2 2 2-FEB-09 8-Mar-09
2 3 9-MAR-09 9-APR-09
2 4 10-APR-09 DEFAULT END DATE
Can this be achieved using a single update query or I have ot write a Procedure ...any help will be appreicaitedor
merge into test
using (select rowid rid
, id
, sub_id
, startdate
, lead (startdate) over (order by id, sub_id) - 1 ed
from test) x
on (x.rid = test.rowid)
when matched then
update set end_date = x.ed
; -
Update a column with value of column of other table
Hi,
I am looking for an update statement for the following scenario
With following 2 tables
TABLE1 (Primary A, B)
TABLE2 (Secondary C , D).
C Column is not unique.
Please provide me an update statement to update TABLE1.B with TABLE2.D where TABLE1. A = TABLE2.C
Please note that TABLE2.C is not unique.
Please let me know whether this satement is correct.
UPDATE TABLE1
SET B = (SELECT DISTINCT D FROM TABLE 2 WHERE A=C )
Thanks
Alla KishoreUPDATE TABLE1 T1
SET T1.B = (SELECT DISTINCT D FROM TABLE2 T2 WHERE T2.C=T1.A )
Maybe you are looking for
-
I have Premiere Pro and AE on my home laptop, I need to download it on my second PC, but on this second PC when I downloaded the Creative Cloud download app on the desktop, it ddid not show any option to download Premiere Pro and AE etc !!! I could d
-
Passing form 1 values to form 2
Hi All, I have Form 1 in which I have fields like location_id, location_code which has values assigned to it. On this Form 1, I have a button, and when clicked, opens a new form Form 2, on which I have location_id, location_code and other new fields.
-
Edit in Photoshop no longer available
I recently replaces PS4 with PS5.1. Now when in Lightroom 3, if I right click a photo, the option to edit in Photoshop is greyed out. Any ideas?
-
Finger print reader is not connected
have hp bavilion dv6 laptop and when i try to use fingerprint it says to me FINGERPRINT READER IS NOT CONNECTED please help ...in this laptop finger print reader is built in !!!
-
How to set applications for automatic updates?
Some apps are updated automatically and others require approval before the update takes place. Is there a way to change an installed app from the approval-needed mode to automatic updates?