Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
sspe_dgs_com
Not applicable

Problem when loading variable from script

Hi,

I'm having a problem when I load a variable from my script.

I'd like to create a variable like below -

Set gvMonthID = Only({1<[Date_Key] = {"$(=Date(Today(),'YYYY-MM-DD'))"}>} MonthID);

It actually load fine without any problems, but in my application it appears as : Only({1<[Date_Key] = {""}>} MonthID)

I simply can't figure out how to prevent it from resolving the $(=Date(Today(),'YYYY-MM-DD')) part when loading, but still include the '$' so it will be resolved in my application. It's most likely very simply and obvious, but I just can't get it right.

Regards

Steen

3 Replies
amartinez35
Not applicable

Re: Problem when loading variable from script

Hi,

Try :

Set gvMonthID = Only({1<[Date_Key] = {"%(=Date(Today(),'YYYY-MM-DD'))"}>} MonthID);

Let gvMonthID = replace('$(gvMonthID)', '%', '$');

Aurélien

mwoolf
Not applicable

Re: Problem when loading variable from script

The apostrophes in your script will cause a problem. You may try replacing them with & chr(39) &

sspe_dgs_com
Not applicable

Re: Problem when loading variable from script

Hi Aurelien,

Thanks for the help. That seems to do the trick. Of course it's a little annoying that I have to do that extra line of code for variables containing a $ sign expansion, but I can live with that.

Regards

Steen