Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Riccardo_1
Contributor III
Contributor III

QMC: After reload variables contains strange values

Hello,

We do use Qlik Sense on premise.

If we reload an app with QMC (manual or by task) the variables in the app get strange values. The reload itself is succesfull without any errors and the data is correct, but all variables do have strange data.

We do use this variables in a straight table columns labels, for example: =vHDeliveredPrevMonth

Before reload we do see the formula for this variable, which is: ='Delivered '&Month(AddMonths(Today(),-1)) & ' ' & Year(AddMonths(Today(),-1))

After reload the variable value is: Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec

Please see screenshots before and after reload.

This happens for all variables in the app.

This app did run for months, but suddenly this strange behavious happend and all column headers in the table has strange values.

How can we fix this issue or are there any ideas where to look?

Kind regards,

Ricardo

Labels (1)
1 Solution

Accepted Solutions
henrikalmen
Specialist II
Specialist II

The image "after reload" show that variable vHDeliveredPrevMonth just contains a comma. I concur with other comments that you could be missing a semi-colon in your code somewhere, so that one variable declaration is mixed up with another. I don't think your issue is with the statement that you are showing in your example, the problem occurs earlier.

Add traces to your code. After each variable declaration, make sure the value is spelled out in the log and then check the reload log. Like this, kind of:

SET myVar = 'Hello ' & 1 & ' world';
TRACE myVar = $(myVar);

View solution in original post

9 Replies
Javizh
Partner - Contributor III
Partner - Contributor III

Hello @Riccardo_1 

It seems like those values are the defined values of the system variables from the "Main" section of the app (The one that gets autogenerated for each app when created)

Javizh_0-1741032209836.png

Maybe the problem is that the app have some code that is causing missinterpretation of that first section, but I cannot tell without looking at the code.

I would reccomend you to check if there is any piece of code before the main section, and if so, try to remove it.

Best regards.

 

marksouzacosta

Hi @Riccardo_1,

I think you are missing a semicolon or maybe a single quote somewhere.
Can you please share your Load Script?

Regards,

Mark Costa

Read more at Data Voyagers - datavoyagers.net
Follow me on my LinkedIn | Know IPC Global at ipc-global.com

Riccardo_1
Contributor III
Contributor III
Author

Hello Javizh,

Thanks for the suggestion. I do not have any code for the main section. Attached is the code from the first section.

There is no section for it and no other code in the first section.

You are indeed correct that the values from the first section are used in the variables. I'm going to take out some code and see what happens.

Thank you very much for thinking with me.

Kind regards,

Ricardo

 

 

Riccardo_1
Contributor III
Contributor III
Author

Hello Mark,

Thank you for your suggestion. I did not know that the lack of a semicolon or single quote could cause this behavior. I was under the assumption that you would then get a reload error.

I will go through the code myself first, as it is quite a lot of code. I think I'm going to re-add it section by section. Hopefully then somewhere the problem will arise and it can be fixed.

I'll let you know how I go.

Huge thanks for this suggestion!

Kind regards,

Ricardo

henrikalmen
Specialist II
Specialist II

The image "after reload" show that variable vHDeliveredPrevMonth just contains a comma. I concur with other comments that you could be missing a semi-colon in your code somewhere, so that one variable declaration is mixed up with another. I don't think your issue is with the statement that you are showing in your example, the problem occurs earlier.

Add traces to your code. After each variable declaration, make sure the value is spelled out in the log and then check the reload log. Like this, kind of:

SET myVar = 'Hello ' & 1 & ' world';
TRACE myVar = $(myVar);

Riccardo_1
Contributor III
Contributor III
Author

Hello,

Thank you for your suggestion. All these variables are set in the Variable editor of Qlik Sense Desktop. Please see screen below.

Riccardo_1_0-1741094578201.png

I did walk though all the code and did not see any semicolon or single quote missing. 

Also I did found out that reload in Qlik Sense Desktop does not give this problem, but reload from QMC does. I did upload the App again to QMC, open the app, the table has the correct column names. As soon as I do reload from QMC and reopen the App, the column names contains strange data.

Even when I import the app as a new App in QMC the column headers look good, but as soon as I do reload column headers have again strange data.

I can do as many reloads in Qlik Sense Desktop with same App and all column headers are correct.

I did enter a breakpoint on the last line in the ETL code. It seems that after the last load statement Qlik is adding the variables which are added through variable module/screen. I cannot add your code for these, but I do see the variables are changed and wrond at that moment.

I will try to SET some of these variables in code instead of the Variable module/screen and see what will happen. Strange thing will be that the Qlik Sense Desktop app doesn't have this issue at all and also in QMC it did run for a long time without any issue.

Many thanks for your suggestion. 

Kind regards.

Ricardo

Riccardo_1
Contributor III
Contributor III
Author

Hi,

I think I found the issue.

I did create variables in the Qlik Sense Desktop with the variable window, like;

Name: vHWeekCurrent

Definition: ='Current ' & 'W'& Week(Today())

As soon as i Import this App in QMC and did a reload, those variables getting wrong values.

I did remove all of these variables and entered them in the load script like;

LET vHWeekCurrent = 'Current ' & 'W'& Week(Today());

Now after the reload all column headers are correct.

I saw in debugging mode that variables entered in Variable Window did get extra double quotes. So

Name: vHWeekCurrent,   Definition: ='Current ' & 'W'& Week(Today())    

changed definition to

Name: vHWeekCurrent,   Definition: ="'Current ' & 'W'& Week(Today())"    

My lesson; never user variable windows but always use load script so you can see what happens.

I want to thank everyone who has kindly taken time to respond. This ultimately helped me solve this problem. Thank you so much for this!

Kind regards

Ricardo

 

henrikalmen
Specialist II
Specialist II

Oh, wow! That's fascinating! But it also seems like a bug! I get why you conclude that you shouldn't use the variable editor, but there are situations when the variable editor is the best option (for example if a variable's value is to be stored in a bookmark). Maybe you should report this in a support case to qlik, especially if you can recreate the problem in a new app.

Riccardo_1
Contributor III
Contributor III
Author

I will try to reproduce the issue in a new app. If this succeeds I will create a case with Qlik. Thanks for advice!

Kind regards,

Ricardo