Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Change number Format MySQL field

Hello everybody,

I am just starting the qlikview connection with a MySql DataBase and I've encountered my first problem which is giving me a hard time.

This is my problem:

I have this sequence of numbers:

123456789

but I just need the first 8 numbers.

As a qlikview script I used the following sentence:

If(Len(number)=9,Left(number,8) as Number

but with the MySql script I can't find a similar function.

Can anybody help me?

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

It is helpful to use preceding load, so you can use SQL functions in the SQL SELECT part and QV functions in LOAD part:

LOAD

If(Len(number)=9,Left(number,8) as Number

;

SQL SELCT

number

FROM my table;

View solution in original post

3 Replies
awhitfield
Partner - Champion
Partner - Champion

Looks like it's

LEFT()

Return the leftmost number of characters as specified

https://dev.mysql.com/doc/refman/5.0/en/string-functions.html

Andy

Anonymous
Not applicable
Author

It is helpful to use preceding load, so you can use SQL functions in the SQL SELECT part and QV functions in LOAD part:

LOAD

If(Len(number)=9,Left(number,8) as Number

;

SQL SELCT

number

FROM my table;

PrashantSangle

Hi,

Qlikview have Left() but you missed closing bracket

If(Len(number)=9,Left(number,8)) as Number

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂