Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
dandaanilreddy
Partner - Creator III
Partner - Creator III

Few Variables not working in qlik sense app

Hello Qlik Developers,

I'm facing issue with some variables in Qlik sense app. My app loads variables from a excel file which contains 1400+ variables. I see 5 variables are not populating in the app. When i take the definition of the variable and check in the app i'm able to see the value. I see those missing variables on the right hand side when i open the expression editor and search for that variable but when i tried to insert the variable in the expression its blacked out. I tried creating the same variable in the app and i see the variable is populating. I want to maintain all the variables in the excel file not on the UI. Please Can someone let me know how to resolve this? I have not faced this issue before.

Thanks

7 Replies
stevejoyce
Specialist II
Specialist II

Can you explain this " when i tried to insert the variable in the expression its blacked out. "

And can you post your excel file of variables and your load script loading it.

dandaanilreddy
Partner - Creator III
Partner - Creator III
Author

Hi Steve,

Thank You for your response. Due to some security reasons i cannot post data but i can explain what the issue below:

  1. Loaded the excel file that contains variable into app.
  2. Created loop script to load variables for the measure values.

In UI straight table in expression editor i tried to type the variable but its not showing. When i checked the variable name on the Bottom right hand side in the expression editor in the variables drop down section i see the variable is populating  with both definition and value. 

Thanks

stevejoyce
Specialist II
Specialist II

So you are seeing it when you are in the Expression editor windows.  If you choose one of the affected variables and hit Insert, it doesn't resolve into a valid result?  Can you share the variable definition? I wouldn't expect this to be sensitive information, it doesn't contain data.

dandaanilreddy
Partner - Creator III
Partner - Creator III
Author

Hi Steve,

Below is my variable:

if(sort='PQ0',

sum({<level={1},Product={'$(vProduct)'},Date={'$(vMin0)'}>}value),

if(sort='PQ1',

sum({<level={1},Product={'$(vProduct)'},Date={'$(vMin1)'}>}value),

if(sort='PQ2',

sum({<level={1},Product={'$(vProduct)'},Date={'$(vMin2)'}>}value),

if(sort='PQ3',

sum({<level={1},Product={'$(vProduct)'},Date={'$(vMin3)'}>}value),

if(sort='PQ4',

sum({<level={1},Product={'$(vProduct)'},Date={'$(vMin4)'}>}value)

)))))

Thanks

stevejoyce
Specialist II
Specialist II

I'm not sure without stepping through with your load script and excel file.  Maybe someone else can input with the info you provided but not enough for me.  Sorry.

 

dandaanilreddy
Partner - Creator III
Partner - Creator III
Author

Thanks Steve. I know its difficult to understand without seeing the script but i cannot share due to security reasons. Below is my script which i wrote in my app.

Measures:

load

VariableName,

Definition

from [Lib://Data/Variable.xlsx]

For i = 0 to NoOfRows('Measures')-1
Let vVarName = Peek('VariableName',$(i),'Measures');
Let [$(vVarName)] = Peek('Definition',$(i),'Measures');

Next i

;

marcus_sommer

If I understand you right the variables exists but you couldn't access them directly.

What happens if you write the variable manually - and not only within the table else in a textbox, a title or another place? If it worked it means the parser / syntax highlighter couldn't handle them properly. Further things to check are:

  • what happens if you change the load-order of the variables
  • check if those variables are loaded several times 
  • changing the variable-names
  • are there tables/fields with the same name
  • do the variable-names conflict with any function-name or reserved terms like load/from/total ...

 If any of these measures changes the behaviour you have found the cause and could adjust your logics.

Beside this I suggest to re-view your variables usage. Not the decision to maintain them externally else the usage itself - do you really need all these variables or could some logics be replaced with table-associations? In regard to your example seems the field-values of [sort] be directly related to the various vMin#. Ideally you could use a single sum() expression instead of using a nested if-loops which could become quite unhandy and which are also not very performant.

- Marcus