Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
i have a data where i need to brand for batch like below, Here Britanna client has 8 batch were it branded to 4 and others each batch with each brand.
client | client_id | batch | batch_id |
Parlegi | 1 | Parlegi 90$ | 21 |
Parlegi | 1 | Parlegi 25$ | 22 |
Britanna | 2 | Britanna crf | 45 |
Britanna | 2 | Britanna crf & Lpf | 43 |
Britanna | 2 | Mango crf | 46 |
Britanna | 2 | Mango crf & Lpf | 44 |
Britanna | 2 | FineApple crf | 47 |
Britanna | 2 | FineApple crf & Lpf | 48 |
Britanna | 2 | gauva crf | 49 |
Britanna | 2 | gauva crf & Lpf | 53 |
UNIBIC | 3 | UNIBIC17/7 | 54 |
UNIBIC | 3 | newflavor | 67 |
UNIBIC | 3 | yflavor | 56 |
Kikat | 4 | Kitkat target - 2nd | 58 |
client | client_id | batch | batch_id | Brand |
Parlegi | 1 | Parlegi 90$ | 21 | Brand 1 |
Parlegi | 1 | Parlegi 25$ | 22 | Brand 2 |
Britanna | 2 | Britanna crf | 45 | Brand 1 |
Britanna | 2 | Britanna crf & Lpf | 43 | Brand 1 |
Britanna | 2 | Mango crf | 46 | Brand 2 |
Britanna | 2 | Mango crf & Lpf | 44 | Brand 2 |
Britanna | 2 | FineApple crf | 47 | Brand 3 |
Britanna | 2 | FineApple crf & Lpf | 48 | Brand 3 |
Britanna | 2 | gauva crf | 49 | Brand 4 |
Britanna | 2 | gauva crf & Lpf | 53 | Brand 4 |
UNIBIC | 3 | UNIBIC17/7 | 54 | Brand 1 |
UNIBIC | 3 | newflavor | 67 | Brand 2 |
UNIBIC | 3 | yflavor | 56 | Brand 3 |
Kikat | 4 | Kitkat target - 2nd | 58 | Brand 1 |
Script:
Load client,
client_id,
batch,
batch_id ;
SQL Select client,
client_id,
batch,
batch_id
from ClientDetails;
How to brand one client with one way and other client batch with other way in Script?
Hi,
Can u pls elaborate on what criteria/condition, we have to brand the data?
Condition is that only for client 2, branding is done based on names and other clients, each batch has different brand.
Even if it is hardcoded also no problem i need to achieve this
I would suggest to create a mapping table with fields like client_id, batch_id and brand name. Using the mapping table you can achieve the branding.
Could you please show some code for this?
Sorry, what I meant was You can create the mapping table in your database or Excel. And then load and use the table. It is also kind of hardcode only.
Hi Supriya,
You have to create two temp tables
1. group by batch id
2. group by brand id
Then link both tables with the common table.
First table with batch id and the second table with the brand if.
Regards,
Rajesh R. S.
9710619502