Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

OmarBenSalem
Esteemed Contributor

Use like with function

Hi guys, stalwar1

If I want to search for every field that contains the A letter I would do :

where field like '*A*'

Now what if I wanted to search for everyfield containing today() ?

How to  that since :

where field like '*Today()*' does not work ; syntax error.


thanks

1 Solution

Accepted Solutions
MVP
MVP

Re: Use like with function

If you want to replace Today() with today's date, you need to use dollar sign expansion:

Let vDate = Today(); // potential need to format using Date() to match your field values

...

LOAD

     FIELD

FROM ...

WHERE FIELD LIKE '*$(vDate)*';

edit:

Or maybe just this?

...

WHERE FIELD = Today();

6 Replies
sureshqv
Esteemed Contributor III

Re: Use like with function

try this

is today()  is value?

where wildmatch(fieldName,'*Today()*')


or

where wildmatch(fieldName,'Today()')

MVP
MVP

Re: Use like with function

Can you post a screenshot of the error message?

MVP
MVP

Re: Use like with function

If you want to replace Today() with today's date, you need to use dollar sign expansion:

Let vDate = Today(); // potential need to format using Date() to match your field values

...

LOAD

     FIELD

FROM ...

WHERE FIELD LIKE '*$(vDate)*';

edit:

Or maybe just this?

...

WHERE FIELD = Today();

OmarBenSalem
Esteemed Contributor

Re: Use like with function

When I created a variable :

let vToday= today()

and then in my condition I used this variable :

where field like '*$(vToday)*' it worked.

OmarBenSalem
Esteemed Contributor

Re: Use like with function

That won't work unless It's stored in a variable then we call the variable.

When I did that, It worked just fine

OmarBenSalem
Esteemed Contributor

Re: Use like with function

Yes, well seen ! I just did that and I worked like a charm !

Community Browser