Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts,
I have this challenge, I have join 2 tables using left join, and my challenge is I have to
1 - Identify records in both tables ( tb1 & tb2) then multiple that with another field in table 1.
2- Identify records not in table1 but in table2 then multiple that with another field in table 3 where field identify equal to Y.
Preferred option is to do this in load script.
See tables below
Table 1 | |
Key | Data |
a | 12 |
b | 3 |
c | 4 |
d | 4534 |
Table 2 | |
Key | Data |
a | 12 |
b | 3 |
c | 4 |
d | 4534 |
e | 89 |
f | 10 |
Table 3 | ||
Month | Identify | Data |
Jan | N | 1 |
feb | N | 2 |
mar | N | 3 |
Apr | Y | 4 |
Thanks in advance
And you always have only one row with Y in table 3?
Hi,
Yes 1 row with Y.
What data model you would like to have in application?
Only 1 table with row number as in Table2 with fields Key and Value as:
-Table1.Data*Table2.Data (if Table2.Key exists in Table1)
-Table3.Data (where Identify='Y')*Table2.Data (if Table2.Key does not exist in Table1)
?
What Month in Table3 is for?
regards
Darek
Hi
Thanks for your help.
This option seems alright.
Table1.Data*Table2.Data (if Table2.Key exists in Table1)
-Table3.Data (where Identify='Y')*Table2.Data (if Table2.Key does not exist in Table1)
Thanks
So, using very easy script it is possible.
You may need to use few typpical clauses: where, exists, if, join or applymap.
Do you need somebody to write this script for you?
regards
Darek
Hi,
Please if you can that will be lovely and much appreciated
Hi,
If you can write the script that would be much appreciated.
Thanks in advance
see attachment for same help