Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
berryandcherry6
Creator II
Creator II

Branding records based on condition

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.

  

clientclient_idbatchbatch_id
Parlegi1Parlegi 90$21
Parlegi1Parlegi 25$22
Britanna2Britanna crf45
Britanna2Britanna crf & Lpf43
Britanna2Mango crf46
Britanna2Mango crf & Lpf44
Britanna2FineApple crf47
Britanna2FineApple crf & Lpf48
Britanna2gauva crf49
Britanna2gauva  crf & Lpf53
UNIBIC3UNIBIC17/754
UNIBIC3newflavor67
UNIBIC3yflavor56
Kikat4Kitkat target - 2nd58

   

clientclient_idbatchbatch_idBrand
Parlegi1Parlegi 90$21Brand 1
Parlegi1Parlegi 25$22Brand 2
Britanna2Britanna crf45Brand 1
Britanna2Britanna crf & Lpf43Brand 1
Britanna2Mango crf46Brand 2
Britanna2Mango crf & Lpf44Brand 2
Britanna2FineApple crf47Brand 3
Britanna2FineApple crf & Lpf48Brand 3
Britanna2gauva crf49Brand 4
Britanna2gauva  crf & Lpf53Brand 4
UNIBIC3UNIBIC17/754Brand 1
UNIBIC3newflavor67Brand 2
UNIBIC3yflavor56Brand 3
Kikat4Kitkat target - 2nd58Brand 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?

6 Replies
arockiyaselvana
Partner - Creator
Partner - Creator

Hi,

Can u pls elaborate on what criteria/condition, we have to brand the data?

berryandcherry6
Creator II
Creator II
Author

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

arockiyaselvana
Partner - Creator
Partner - Creator

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.

berryandcherry6
Creator II
Creator II
Author

Could you please show some code for this?

arockiyaselvana
Partner - Creator
Partner - Creator

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.

Not applicable

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