Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using quotes in variable

Hi,

I am trying to define a variable to give a value like

WHERE trunc(pxcreatedatetime) >=to_date('10/3/2014','DD/MM/YYYY')

Here is what I am trying but it's not working:

LET INCREMENTAL_EXP = 'WHERE trunc(pxcreatedatetime) >=' & 'to_date(' &'char(39)'& fieldValue('maxdate', 1) &'char(39)' & ')';

In the above statement, maxdate gets resolved successfully to 10/3/2014.  I am looking for way to insert quotes before and after 10/3/2014.

Thanks,

Sudha.

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I find it easiest to use a proxy character and then replace().

LET INCREMENTAL_EXP = replace('WHERE trunc(pxcreatedatetime) >=to_date(|10/3/2014|,|DD/MM/YYYY|)','|',chr(39));

-Rob

http://masterssummit.com

http://robwunderlich.com

View solution in original post

4 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I find it easiest to use a proxy character and then replace().

LET INCREMENTAL_EXP = replace('WHERE trunc(pxcreatedatetime) >=to_date(|10/3/2014|,|DD/MM/YYYY|)','|',chr(39));

-Rob

http://masterssummit.com

http://robwunderlich.com

Not applicable
Author

Thanks Rob.  It works.

pokassov
Specialist
Specialist

Hello!

Let INCREMENTAL_EXP='where trunc(pxcreatedatetime)>=to_date('&Chr(39)&Today()&Chr(39)&',''DD/MM/YYYY'')';

Not applicable
Author

Thank you so much.  This helped