Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

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

Tags (1)
1 Solution

Accepted Solutions
erich_shiino
Honored Contributor

Variable to suffix with a concat function

Ok,

Thy this then:

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

Regards,

Erich

4 Replies
erich_shiino
Honored Contributor

Variable to suffix with a concat function

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

Variable to suffix with a concat function

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.

erich_shiino
Honored Contributor

Variable to suffix with a concat function

Ok,

Thy this then:

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

Regards,

Erich

Not applicable

Re: Variable to suffix with a concat function

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