Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

andymanu
Contributor

Filter the field data based on a particular value

Hi,

Got a new question going slightly beyond the question I asked in the morning.

Assume the table I am referring looks as below,

  

Item_CodeItem_Name
CBDG3CDA
124567D
DEFACDE
243671G
CDH
AGHDK2N
CDM

This time I want to filter the data based on the below requirements;

1. Select the last two characters of the Item_Code.

2. I want to Flag/Filter the Item_Codes which ONLY got "CD" letters at the END.

Note

Item_Code could just "CD" or it could be the last two letters of a text value.

The out put should be something like below,

  

Item_CodeItem_Name     Flag
CDBG3CDA1
124567D0
DEFACDE1
CD3671G0
CDH1
AGHDK2N0
CDM1

Could anyone help me with the above task, would be greatly appreciated.

Regards,

Andy

2 Replies
andymanu
Contributor

Re: Filter the field data based on a particular value

Hi,

I used the below command but it did not give me the correct answer,

If(Right(Item_Code,2)= 'NC',1,0) as Flag

Could you please correct me on the above statement?

Thanks in advance

Regards,

Andy

nitin_01
Contributor

Re: Filter the field data based on a particular value

Hi Andy,

Test:

Load *,

     If(Right(Item_Code,2)='CD',1,0) as Flag;

Load * Inline [

Item_Code,Item_Name

CBDG3CD,A

124567,D

DEFACD,E

243671,G

CD,H

AGHDK2,N

CD,M

];

demo.PNG

Its working Andy. Where do you find issue?

Regards,

Nitin G.

Community Browser