Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
berryandcherry6
Not applicable

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?

Tags (2)
6 Replies
arockiyaselvana
Not applicable

Re: Branding records based on condition

Hi,

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

berryandcherry6
Not applicable

Re: Branding records based on condition

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
Not applicable

Re: Branding records based on condition

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
Not applicable

Re: Branding records based on condition

Could you please show some code for this?

arockiyaselvana
Not applicable

Re: Branding records based on condition

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

Re: Branding records based on condition

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