Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
simonagheo
Contributor III
Contributor III

Text key starting with 0

Hello,

I have a table with two fields: Code and Description. In this table I have the following information:

Code/Description

01/Descr1

001/Descr2

0 01/Descr3

When I select the 0 01 code, qlik returns Descr1, Descr2 and Descr3 as a description.

How can I differentiate between these codes?

PS:1. Code is also used as a key between two tables.

2. I tried text(code) and '.'@code and it doesn't work.

Thank you!

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Just use a preceding LOAD with Text() function (assuming your two fields you mentioned above. If field names differ or you need to read in more fields, just adapt accordingly):

LOAD

     Text(Code) as Code,

     Description;

SQL SELECT *

FROM TabA;

View solution in original post

10 Replies
sunny_talwar

May be try this:

Dual(Text(code), RowNo()) as code

swuehl
MVP
MVP

When you are using your current script, what do you see in your list box for code? Only '0 01' ?

Then your values are interpreted as the same number, 1.

I think

Text(code) AS code

might and should work when used in the LOAD that accesses your data source.

Could you post the script code where you have tried that?

If you want to concatenate a point, use

'.' & code AS code

engishfaque
Specialist III
Specialist III

Dear Simona,

Write down listed below code in your scirpt,

RowNo() & YourFieldName as newFieldName

Kind regards,

Ishfaque Ahmed

simonagheo
Contributor III
Contributor III
Author

Yes, in my listbox is only '0 01'

The script is:

TabA:

LOAD [Code1] AS Code,

    [Description]

FROM TabA.qvd (qvd);

TabB:

LOAD [Code2] AS Code,

    [OtherInfo]

FROM TabB.qvd (qvd);

I tried: TEXT([Code1]) AS Code,TEXT([Code1]) AS Code  and '.'&[Code1] AS Code, '.'&[Code2] AS Code and both of them didn't work. 

swuehl
MVP
MVP

I think the values are already wrong in your QVD (you can check this by examination of the QVD xml table meta data.

I believe you should apply the Text() function when you are loading from your original data source, like when loading from the SQL database.

engishfaque
Specialist III
Specialist III

Dear Simona,

You can do it by listed below script,

Dual(YourFieldName, RowNo()) As newFieldName

Kind regards,

Ishfaque Ahmed

simonagheo
Contributor III
Contributor III
Author

In the QVDs document my script is like:

SQL SELECT *

FROM TabA;

How can I change this to accept the Text() function?

swuehl
MVP
MVP

Just use a preceding LOAD with Text() function (assuming your two fields you mentioned above. If field names differ or you need to read in more fields, just adapt accordingly):

LOAD

     Text(Code) as Code,

     Description;

SQL SELECT *

FROM TabA;

simonagheo
Contributor III
Contributor III
Author

I tried this solution, but it makes weird links between Tabs A and B. I think Qlik links these tables by RowNo(), not by code.