Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
DataKnight1
Contributor III
Contributor III

Display a value as feet (') and inches (")

Hi,

I'm assuming this will be relatively easy, and hopefully save me some time!  I'm wanting to change the way two separate values are displayed and want to do this in the load script.

I have a value, for example;

20

I want to display this as feet;

20'

I have another value, for example;

6

I want to display this as inches;

6"

Firstly, how would this be achieved?

My end result, after combining the two fields will be;

20' 6"

Thanks

Labels (3)
1 Solution

Accepted Solutions
MayilVahanan

Hi,

Actually, I've provided the sample data & solution.

In your script, you can use like below

YourFeetFieldName&chr(39)&YourInchFieldName&'"' as FieldInch 

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

4 Replies
MayilVahanan

Hi

Hope you have 2 fields like below

Load *, Feet&chr(39)&Inch&'"' as FeetInch Inline
[
Feet, Inch
20, 6
];

 

Feet&chr(39)&Inch&'"' as FeetInch <-- helps to achieve the expected results.

 

Regards,

Mayil Vahanan R

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
DataKnight1
Contributor III
Contributor III
Author

Hi Mayil,

Thanks for your prompt response.

Whilst your solution would fix the specific values in question - what if there were thousands?  I don't want to key each one in an INLINE table...

Eg;

DataKnight1_0-1602233681818.png

So may aim is to reformat the fields in script so they display as;

1'0"

2'0"

3'0"

4'0"

4'6"

etc...

MayilVahanan

Hi,

Actually, I've provided the sample data & solution.

In your script, you can use like below

YourFeetFieldName&chr(39)&YourInchFieldName&'"' as FieldInch 

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
DataKnight1
Contributor III
Contributor III
Author

Great - thanks very much!

DataKnight1_0-1602234478570.png

 

Have a good day.

Simon