Qlik Community

Ask a Question

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Support Case Portal will move to Qlik Community Oct 4. Temporary case outage Oct 3. READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Uri
Contributor III
Contributor III

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 (3)
1 Solution

Accepted Solutions
Uri
Contributor III
Contributor III
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
Contributor III
Contributor III
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
Contributor III
Contributor III
Author