Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Field Format

Hey folks,

I have a SQL-Table from which I need a field (TBRKEY).

Thus I request the data with:

TBPOSP_mit:

  load *; SQL select * from TBPOSP where TBTBGR = 'FRD' and TBSART = '122' and TBSPRA = '  ' and TBFIRM = '010';

I get the following result:

Attention to the format of TBRKEY!!!

TBPOSP_Mit.png

But the whole where case is not possible in my specific case.

Thus I request the data with:

TBPOSP:

  load *; SQL select * from TBPOSP;

After selecting the correct fields I get the following result:

Attention to the format of TBRKEY!!!

TBPOSP_Ohne.png

Why are there zeros in front of the numbers?

In my opinion I should get in both cases the same result, but as you can see here it is not.

Any ideas why this behavior is like this and workarounds?

If this may help, the TBRKEY-field is saved in a SQL database with a field length of 10 and the field type is alphanumeric.

14 Replies
Anonymous
Not applicable
Author

Unfortunately not, as you can see in the following screenshot. I removes my characters.

Don't understand why.

TBPOSP_Ohne_NUM_funkt.png

Anonymous
Not applicable
Author

I have no idea, I would just use num(TRBKEY) , QlikView does the job for you.

swuehl
MVP
MVP

Since the field is called TRBKEY, are there more as 1 table from your DB involved?

Have you checked the format in all tables?

rubenmarin

Hi, you can try with.

Alt(TBRKEY, TBRKEY) as TBRKEY_correct,


It's seems a little pretty to me.

or: Alt(num(TBRKEY), TBRKEY) as TBRKEY_correct

Anonymous
Not applicable
Author

You were definite wright!

Qlik loads the first value and used the format on the other tables.

The solution:

Before the SQL load I used the Qlik-Cast.

Result:

load *,text(TBRKEY) as myKey; SQL select * from TBPOSP;

And now I always get the correct solution.

Thanks to your and the answer of the other people!!!