Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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?
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
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]
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
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
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
Hi Mark.
Yes, the latest version.
Below you can find example.