Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How decode numeric values

Hi ,

Is there any way to decode numeric values .

for example Article with "ABC" format.

ABC Coding :

A :

0=Men's Casual Shoes ,

1=Men's Sports Shoes ,

2=Boy's casual Shoes ,

3=Girl's casual shoes ,

4=women's Canvas Shoes ,

5=Men's Sandals ,

6= Women's Sandals ,

7= Girl's Sandals ,

8=Men's Formal Shoes ,

9= Women's Formal Shoes

=========================

B:

0=black Color ,

1= White Color ,

2=Tan ,

3=Grey ,

4=Beige ,

5=Brown ,

6=Blue ,

7=Maroon ,

8=pink,

9=Multi Color

=========================

C:

0=Size 6 ,

1=Size 6.5 ,

2=Size 7 ,

3=Size 7.5 ,

4=Size 8 ,

5=Size 8.5 ,

6=Size 9 ,

7=Size 9.5 ,

8=Size 10 ,

9=Size 10.5

========================

For example  Article "183" means "Men's Sports Shoes , Pink Color , Size 7.5 "

1 Solution

Accepted Solutions
Not applicable
Author

You can get this by mapping tables and please find the attached file for reference.

MAP_Material:

Mapping

LOAD * INLINE [

Code1,Material

0,Men's Casual Shoes

1,Men's Sports Shoes

2,Boy's casual Shoes

3,Girl's casual shoes

4,women's Canvas Shoes

5,Men's Sandals

6,Women's Sandals

7,Girl's Sandals

8,Men's Formal Shoes

9, Women's Formal Shoes];

MAP_Color_of_Shoes:

Mapping

LOAD * INLINE [

Code2,Color

0,black Color

1,White Color

2,Tan

3,Grey

4,Beige

5,Brown

6,Blue

7,Maroon

8,pink

9,Multi Color];

MAP_Size_of_Shoes :

Mapping

LOAD * INLINE [

Code3,Size

0,Size 6

1,Size 6.5

2,Size 7

3,Size 7.5

4,Size 8

5,Size 8.5

6,Size 9

7,Size 9.5

8,Size 10

9,Size 10.5 ];

Article:

LOAD *,

ApplyMap('MAP_Material',Left(Article,1),'-NA-') &' , '& ApplyMap('MAP_Color_of_Shoes',mid(Article,2,1),'-NA-')  &' , '& ApplyMap('MAP_Size_of_Shoes',Right(Article,1),'-NA-')  AS Description

INLINE [

Article,

123,

183,

020,

200

];

View solution in original post

6 Replies
Gysbert_Wassenaar

You can use mapping tables and applymap:

MapA:

mapping load * inline [

0,Men's Casual Shoes

1,Men's Sports Shoes

2,Boy's casual Shoes

3,Girl's casual shoes

4,women's Canvas Shoes

5,Men's Sandals

6, Women's Sandals

7, Girl's Sandals

8,Men's Formal Shoes

9, Women's Formal Shoes

];

// imagine MapB and MapC here

Result:

Load

ABC,

applymap('MapA', left(ABC,1)) as Product,

applymap('MapB', mid(ABC,2,1)) as Color,

applymap('MapC', right(ABC,1)) as Size

from ...sourcetable;



talk is cheap, supply exceeds demand
rustyfishbones
Master II
Master II

Can you share the App?

Your example is a bit confusing

Not applicable
Author

Hi.

Try text() function:

text(expression ) = text(123)

The text function forces the expression to be treated as text, even if a numeric interpretation is possible.

From there you can use string functions like

left( ), right(), mid() etc.

There are a number of functions available, choose one you like.

As an example:  =left(text(456), 1) returns 4

Regards,

Gerrit

Not applicable
Author

Dear Gysbert,

do you have an example?

Not applicable
Author

You can get this by mapping tables and please find the attached file for reference.

MAP_Material:

Mapping

LOAD * INLINE [

Code1,Material

0,Men's Casual Shoes

1,Men's Sports Shoes

2,Boy's casual Shoes

3,Girl's casual shoes

4,women's Canvas Shoes

5,Men's Sandals

6,Women's Sandals

7,Girl's Sandals

8,Men's Formal Shoes

9, Women's Formal Shoes];

MAP_Color_of_Shoes:

Mapping

LOAD * INLINE [

Code2,Color

0,black Color

1,White Color

2,Tan

3,Grey

4,Beige

5,Brown

6,Blue

7,Maroon

8,pink

9,Multi Color];

MAP_Size_of_Shoes :

Mapping

LOAD * INLINE [

Code3,Size

0,Size 6

1,Size 6.5

2,Size 7

3,Size 7.5

4,Size 8

5,Size 8.5

6,Size 9

7,Size 9.5

8,Size 10

9,Size 10.5 ];

Article:

LOAD *,

ApplyMap('MAP_Material',Left(Article,1),'-NA-') &' , '& ApplyMap('MAP_Color_of_Shoes',mid(Article,2,1),'-NA-')  &' , '& ApplyMap('MAP_Size_of_Shoes',Right(Article,1),'-NA-')  AS Description

INLINE [

Article,

123,

183,

020,

200

];

Not applicable
Author

Fantastic Answer.

Thanks.