Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Commenting in variables - issue

Hi,

I think I found commenting issue in variables.

Let's try to create two variables:

vOne

=2+ count(

sth)

//comment

vTwo

=1

Now try to add $(vOne)+$(vTwo).  Let's assume that count(sth) returns 10.

The result should be 13.

But it's 12.

It's seems that comment in variable deactivate or clears everything after this comment. (in this case clears the "vTwo" variable)

Is this intended? Or another issue with Qlik's syntax?

15 Replies
marcus_sommer

I agree that there is some space for improvements by the variable-handling including adding and viewing of comments but even if I repeat myself the variable-content is a rather unsuitable place for it and is rather uncommon in the most scripting/programming-tools.

If you really want to keep everything in one place you will need to use external sources - a central repository - for it. Of course this is possible and had some advantages, too but the efforts to implement a stable solution will be quite expensive.

Beside them I personally don't need very often to look within the variable-editor because I do usually use variables only there where it really simplified my (developer) live. A massive use of variables could be lead to quite the opposite ...

- Marcus

Anonymous
Not applicable
Author

I think you lost the point of the discussion.

It's not about using $-expression, it's not about let/set choice, it's not about which place is better for description etc.

The problem is following:

Qlik Sense allows us to create and define variables in the "variable editor".

QS allows us to comment their content.

But this solution seems to be not working properly. It can crush your work.

The point was to investigate if this is an unexpected issue. And I think we found the answer.

btw

"In this sense commentings within variables are just error-prone and you should avoid them."

If something has been implemented by QS - it should work.

If there is a problem - solve it, do not avoid. [petition for QS Team]

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I'm working on some variable tooling and I am just trying to understand the various ways people use variables. I don't have an opinion on your original question beyond what Marcus has suggested.

-Rob

Mark_Little
Luminary
Luminary

Just tried this on mine and works fine.

I.E. the comment is compeltely ignored by the calculation.

Are you running the latest version of Qlik Sense?

Mark

marcus_sommer

Sorry, but I could not agree with you. Of course you could comment variables within their content but you need to consider various things (already mentioned above) by doing it and I think in your example it's not done properly.

From my point of view it worked like it should (although various improvements would be much appreciated). Maybe hic could shed some lights on it.

- Marcus

Anonymous
Not applicable
Author

Hi Mark.

Yes, the latest version.

Below you can find example.

Capture.PNGCapture2.PNG

Capture3.PNG