Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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!
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;
May be try this:
Dual(Text(code), RowNo()) as code
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
Dear Simona,
Write down listed below code in your scirpt,
RowNo() & YourFieldName as newFieldName
Kind regards,
Ishfaque Ahmed
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.
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.
Dear Simona,
You can do it by listed below script,
Dual(YourFieldName, RowNo()) As newFieldName
Kind regards,
Ishfaque Ahmed
In the QVDs document my script is like:
SQL SELECT *
FROM TabA;
How can I change this to accept the Text() function?
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;
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.