Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Variable to suffix with a concat function

Hi!

Continuing the toggle questions.
I have data in Celsius. Managed, with help, to create a variable and a button that toggle between Celsius and Fahrenheit.
Just for fun I wanted to add Kelvin as well-
It was proposed to me that I in my loading script create a column for each suffix.

So I'm loading:
Medeltemp as medeltemp_c,
1.8*Medeltemp+32 as medeltemp_f,
Medeltemp+273 as medeltemp_k

Now I should be able to refer to the columns with a concat function:
=concat('medeltemp'&vTemp), works like a charm.
=max(concat('medeltemp'&vTemp)), don't work...

regards
thomas

1 Solution

Accepted Solutions
erichshiino
Partner - Master
Partner - Master

Ok,

Thy this then:

=max($(='medeltemp' & vTemp))

Regards,

Erich

View solution in original post

4 Replies
erichshiino
Partner - Master
Partner - Master

What is the definition of vTemp?

Why do you need concat in your example?

Your problem with max maybe that inside is not a number (it's probably) a string.

You can try: =maxstring(concat('medeltemp'&vTemp))

or =maxstring( 'medeltemp'&vTemp)

or =max( medeltemp) & vTemp

Not applicable
Author

Hi!

=max(medeltemp_c)  gives 22.2

medeltemp_f should then give 71.96 and medeltemp_k 295.2 All these values are in one table. The variable holds only _c (for Celsius), _f or _k. Toggeled by a button that actualy changes the variable with an if-statement. The idea is to use medeltemp + variable to show the selected value.

erichshiino
Partner - Master
Partner - Master

Ok,

Thy this then:

=max($(='medeltemp' & vTemp))

Regards,

Erich

Not applicable
Author

Worked! Question now is why? What does $ do?

My isp have not refreshed dns so this is a reply through iphone mail.

I will mark it solved tomorrow.

//thomas

Skickat från min iPhone 4

10 maj 2011 kl. 19:07 skrev "Erich Shiino" <qliktech@sgaur.hosted.jivesoftware.com<mailto:qliktech@sgaur.hosted.jivesoftware.com>>:

QlikCommunity<http://community.qlik.com/index.jspa>

Re: Variable to suffix with a concat function

created by Erich Shiino<http://community.qlik.com/people/erich.shiino> in New to QlikView - View the full discussion<http://community.qlik.com/message/115027#115027