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

Math Operations using Strings

Hi, i'm quite new in qlik sense and i'v a problem that may be simple to solve, but confused me.

I need to cut a string and then use the remaining numbers to make a calculation.  Here is my code:

 

=num#(left('1.96534 GB',len('1.96534 GB')-3))*1024

 

Were '1.96534 GB' is a sample of my collumn value. 

Doesn't matter what i do it always return '-' (null i guess).

 

What am i doing wrong?

Labels (2)
1 Solution

Accepted Solutions
Fernando_Fabregas
Creator II
Creator II

Hi ! The problem is the decimal separator. 

Perhaps this isn't the best solution, but it works fine if your decimal sep is ',' :  

=Replace( left('1.96534 GB', len('1.96534 GB')-3), '.', ',') * 1024

Regards, Fernando

 

View solution in original post

3 Replies
Fernando_Fabregas
Creator II
Creator II

Hi ! The problem is the decimal separator. 

Perhaps this isn't the best solution, but it works fine if your decimal sep is ',' :  

=Replace( left('1.96534 GB', len('1.96534 GB')-3), '.', ',') * 1024

Regards, Fernando

 

Kushal_Chawda

@MBC  try below

=KeepChar(YourField,'0123456789.')*1024

 

MBC
Contributor
Contributor
Author

Hi @Fernando_Fabregas , You are right!! 

 

The Problem was the decimal separator! 

 

Thanks!