Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Uri
Creator
Creator

Expression ---> Variable

Hi,

I want to convert my expression to a variable. I plan to use this variable in NPrinting dynamic report names.

The below script gives me what i want, the only problem is that DateField has to be in  'YYYYMM' format.

LET vNprinting = '=max({<FIELD1={'XXXXXXX'}, FIELD2={'xxxxxxxx'}>}total DateField)'

I tried this way but it didnt work:

LET vNPrinting =  '=date(date#(max({<FIELD1={'XXXXXXX'}, FIELD2={'xxxxxxxx'}>}total DateField),'YYYY-MM-DD'),'YYYYMM')'

 

 

Labels (2)
1 Solution

Accepted Solutions
Uri
Creator
Creator
Author

3 Replies
askarkhan
Contributor III
Contributor III

This should work. 

Might be there is problem with the format which you are providing in "total DateField".

try removing Date# you might get result.

If not share a screenshot of the fields you are using.

Uri
Creator
Creator
Author

Hi @askarkhan ,

I guess that the brackets causing the problem...

I cant use my expression in a variable without "" brackets....

This expression works in my table:

=date(date#(max({<FIELD1={'XXXXXXX'}, FIELD2={'xxxxxxxx'}>}total DateField),'YYYY-MM-DD'),'YYYYMM')'

But I cant use it in a variable, so when I change the type of the brackets, it doesnt work:

LET vNPrinting =  '=date(date#(max({<FIELD1={"XXXXXXX"}, FIELD2={"xxxxxxxx"}>}total DateField),"YYYY-MM-DD"),"YYYYMM")'

 

Uri
Creator
Creator
Author

Hi,

solved this by using an escape sequence:

Escape sequences - Qlik Community - 1469770