A variable definition (which is created in qvw document under Setting -> Variable Overview -> Add) disappears after distribution. This behavior is working as designed. During reload and distribution the document is opened without data - for optimization reasons. During that time variables defined in the document are not available.
Conditions:
- Variables are defined in documents. (under Settings -> Variable Overviews -> Add)
- [+] checkbox is checked.
![variable difinition.png variable difinition.png](https://community.qlik.com/t5/image/serverpage/image-id/169791i00B003541ADABD5B/image-dimensions/608x479?v=v2)
Workaround One
Create and define a variable in the script, not in the document.
e.g.
SET Variable1=today();
Workaround Two
Uncheck [+] checkbox in the Variable Overview.
- Navigate to Settings -> Variable Overview...
![variable overview.png variable overview.png](https://community.qlik.com/t5/image/serverpage/image-id/169792i5409309B4E20C0A2/image-size/large?v=v2&px=999)
- Uncheck [+] from the checkbox.
![uncheck + tickbox.png uncheck + tickbox.png](https://community.qlik.com/t5/image/serverpage/image-id/169793i886BEA22D119DDD7/image-dimensions/534x413?v=v2)
Cause
Product Defect ID: QV-25116
Related Content
Script variables
Environment