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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Weird Error with a Let statement?

So when I use this expression in a text sheet object it works fine, I get the value that is displayed and I have confirmed it works correctly.

But I started using it a lot so i decided to make a let expression for it. When i put it in a let statement the compiler gets angry and it has the red underline and says unknown error

//Morning INV

Let MorningINV= Sum({<DDGDayStart={'$(vToday)'}>}[DDG Inventory]);

error.PNG

15 Replies
Anonymous
Not applicable
Author

They either give a blank text object or an expression error is displayed on the text object.

sunny_talwar

Try this

LET MorningINV = 'Sum({<DDGDayStart = {"$' & '(vToday)"}>}[DDG Inventory])';

MK9885
Master II
Master II

Let MorningINV= ' Sum({<DDGDayStart={'$(vToday)'}>}[DDG Inventory]) ';

Maybe use ' ' ??

Whats the use of creating a variable in script when you can do it in front end, easier to modify too

sunny_talwar

Give this a short

LET MorningINV = 'Sum({<DDGDayStart = {"$' & '(vToday)"}>}[DDG Inventory])';

Anonymous
Not applicable
Author

This worked!! Thank you!

sunny_talwar

Used the same logic from what was given by Stefan here

Expression as a variable with $-sign expansion