Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have one Table as T1
Leaders | Ebitda % |
A | 3 |
B | 5 |
C | 16 |
D | 28 |
E | 18 |
And the other as Table T2
Start Ebidta % | End Ebidta % | Category |
0 | 10 | 0-10 % |
10 | 20 | 10-20 % |
20 | 100 | 20% + |
I want to use Interval Match so that my category is made in T1 according to the logic in T2
This is fairly straightforward
T1:
LOAD
Leaders,
[Ebitda %]
FROM [...]
;
T2:
LOAD
[Start Ebidta %],
[End Ebidta %],
Category
FROM [...]
;
Link:
INTERVALMATCH([Ebitda %])
LOAD
[Start Ebidta %],
[End Ebidta %]
RESIDENT [T2]
;
//n.b. Link now contains [Ebitda %], and the related [Start Ebidta %], [End Ebidta %]
-------
At this point you can left join on to T1 from Link (then drop it), and from T2
Note that you will have issues if [Ebitda %] is 10% or 20% as this will match to more than one record in T2, so you may wish to reduce the Start or End Ebitda % values to avoid this
This is fairly straightforward
T1:
LOAD
Leaders,
[Ebitda %]
FROM [...]
;
T2:
LOAD
[Start Ebidta %],
[End Ebidta %],
Category
FROM [...]
;
Link:
INTERVALMATCH([Ebitda %])
LOAD
[Start Ebidta %],
[End Ebidta %]
RESIDENT [T2]
;
//n.b. Link now contains [Ebitda %], and the related [Start Ebidta %], [End Ebidta %]
-------
At this point you can left join on to T1 from Link (then drop it), and from T2
Note that you will have issues if [Ebitda %] is 10% or 20% as this will match to more than one record in T2, so you may wish to reduce the Start or End Ebitda % values to avoid this