Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

mallikarjun_h
New Contributor III

is it possible to write expression immediatly after SET statement?

consider SET D = 11;

I want to write expression in place of "D" which will give output 'D' .................... is it possible because I am getting error.

3 Replies
MVP
MVP

Re: is it possible to write expression immediatly after SET statement?

You can. But there would be questions, why do you want so? may be this will not serve your purpose; there could be a better option. You have to understand that whatever you write immediate after SET is expected to be a string that is place holder/variable name. If any keywoord is found there, qv parser might throw error. So, if you really need that you have to forcefully make qv understand that it's a string(variable name), like:

Set "Sum(A)"=11;

Re: is it possible to write expression immediatly after SET statement?

You can use

SET "$(vVariableName)" = 11;

for dynamic variable creation. But that's about it.

MVP
MVP

Re: is it possible to write expression immediatly after SET statement?

Hi

If I understand your requirements correctly, then this should work:

Let vVarName = <some expression that returns D>;

Set $(vVarName) = 11;

Set vVarName = ;     // to 'delete' vVarName if no longer needed

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Community Browser