Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Compring Values of same column
Sankari
HI,
I have the iob with the following data
ROW-COL-NEWVAL-OLDVAL
111-1-A-A
111-2-B-B
111-3-C-F
111-4-D-D
222-1-A-null
222-2-B-null
222-3-C-null
222-4-D-null
222-1-A-null
222-2-B-null
222-3-E-null
222-4-D-null
333-1-A-A
333-2-B-B
333-3-C-G
333-4-D-D
I have modified the iob so it has the following :
ROW-COL-NEWVAL-OLDVAL
111-1-A-A
111-2-B-B
111-3-*C-F
111-4-D-D
222-1-A-null
222-2-B-null
222-3-C-null
222-4-D-null
222-1-A-null
222-2-B-null
222-3-E-null
222-4-D-null
333-1-A-A
333-2-B-B
333-3-*C-G
333-4-D-D
It comapares the OLDVAL and NEWVAL columns. If both the values are different it appends '*' infront of the NEWVAL.
This is applicable for the Row id and 111 and 333 since it has both NEWVAL and OLDVAL.
But for the row id 222, we have oly NEWVAL column.
so in this case, we need to compare first four rows of the 222 with next 4 rows of 222 in the order of the COL.
Hence in the 7th row, we have to append * in front of the NEWVAL (ie : *c)
So the final out has to be like below.
ROW-COL-NEWVAL-OLDVAL
111-1-A-A
111-2-B-B
111-3-*C-F
111-4-D-D
222-1-A-null
222-2-B-null
222-3-*C-null
222-4-D-null
222-1-A-null
222-2-B-null
222-3-E-null
222-4-D-null
333-1-A-A
333-2-B-B
333-3-*C-G
333-4-D-D
TO make it clear, how to compare the values of same column to implement this scenario in IOB.
If not in IOB, is der any possibility to do this with RPT design.My version is 3.2.17(version 10)
Please help me on this . I am badlu in need of this help
Find more posts tagged with
Comments
thuston
How did your data end up broken like that? Can you go back to the SQL and fix it?
mcremer
As thuston says prity broken. You could create a SQL Query that joins that data so you ahve 2 columns.
Or you could use 2 tables were you match data from the 1st column against the other. But I prefere fixing the query as Thuston says.
235383
<blockquote class='ipsBlockquote' data-author="'mcremer'" data-cid="82088" data-time="1314711487" data-date="30 August 2011 - 06:38 AM"><p>
As thuston says prity broken. You could create a SQL Query that joins that data so you ahve 2 columns.<br />
<br />
Or you could use 2 tables were you match data from the 1st column against the other. But I prefere fixing the query as Thuston says.<br /></p></blockquote>
<br />
<br />
Am not getting what u say...<br />
<br />
Already i have a hectic process which is carried over in the report....<br />
<br />
I have used a script to append some values and populated those values in three different grids inside the table..<br />
<br />
I have attached two tab specific notepads.<br />
<br />
First (1.txt) has the original iob values<br />
Second (2.txt) is the result i am expecting.<br />
<br />
In the 2.txt, we need to concern oly on 1, 6 and 13.<br />
<br />
In SNO 1, since old val and new val is different , am highligting new val with '*'<br />
Same in SNO 13.<br />
<br />
But in SNO 6, since we does not have old valu , v need to consider the value of SNO 9.<br />
<br />
BSince both are different, i have to append '*' to the SNO 6 value.<br />
<br />
AM not sure how to do this.<br />
<br />
Can u take the attached notepad as data source and implement this logic and if possible would u be able to give me a RPT with the dataset as the attached notepad.<br />
<br />
<br />
My version is 3.2.17<br />
<br />
I would be really grate full, if u help me on this...<br />
<br />
<br />
Thanks
thuston
You need to fix the data. Any report solution will be harder than just getting it right the first time.<br />
<br />
Assume the ROW-COL-NEWVAL-OLDVAL result is table1.<br />
Do something like this. <br />
<pre class='_prettyXprint _lang-auto _linenums:0'>Select * from table1 t1 where t1.OLDVAL is not null
UNION ALL
Select t2.row, t2.col, t2.newval, t3.newval
from
(Select * from table1 t2
Left outer join table1 t3 on t2.row = t3.row and t2.col = t3.col and t2.oldval is null and t3.oldval is null)</pre>
I know it wont work as-is but it should be close.