Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Qlikview version of sql .

 

What is the qlikview version of this SQL server query ?

CAST(Company.Company_Id AS INT) AS REL_ID

Thanks a lot.

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Good to know it is hex...

This should work:

num(num#(right(Company.Company_Id,15),'(HEX)')) as REL_ID

But I had to cut the length a little using right() for the last 15 digits.  QlikView can't use numbers longer than 15 digits.  Try this, it returns 3906:

=num(num#(right('0000000000000F42',15),'(HEX)'))

View solution in original post

9 Replies
Anonymous
Not applicable
Author

num(Company.Company_Id,'#,##0') as REL_ID

Not applicable
Author

This is making my REL_ID to 0.

after num(Compnay.Company_ID,'#,##0') ,0000000000000F42 should become 3906,but it is displaying 0.

Anonymous
Not applicable
Author

Good to know it is hex...

This should work:

num(num#(right(Company.Company_Id,15),'(HEX)')) as REL_ID

But I had to cut the length a little using right() for the last 15 digits.  QlikView can't use numbers longer than 15 digits.  Try this, it returns 3906:

=num(num#(right('0000000000000F42',15),'(HEX)'))

Not applicable
Author

YES !! It did work Thanks a bumch.

Not applicable
Author


Michael,

I have an account number field with account number 00508166730000000098.

How can I conver this account number into 50681376-42 ?

In Oracle I know I can dod it using ltrim and substring function.

LTRIM(SUBSTR(ACCOUNT_NO,3,8),0) || '-' || LTRIM(SUBSTR(ACCOUNT_NO,11),0).

If you find some time please help me with this.

Thanks a lot for your time.

Anonymous
Not applicable
Author

I guess you want this:

=num(mid(ACCOUNT_NO,3,8)) & '-' & num(mid(ACCOUNT_NO,11))

Although I'm not sure because the result is a little different for your data (00508166730000000098😞

50816673-98

Not applicable
Author

As Saidby Michael we use 

=num(mid(ACCOUNT_NO,3,8)) & '-' & num(mid(ACCOUNT_NO,11))


for ocnversions, but the number it should return is some what different, could you recheck the question?

Not applicable
Author


Thank you Michael.You are absolutely right.It was my bad.I used the wrong output in my question.

Not applicable
Author


Thank you Gayathri for the heads up.It was my bad.