Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

rekha_jv
New Contributor III

Set Expression

Hello All,

I am getting "-" for this set expression

Only({$<[Received Date]={"$(vYesdate)"}>}[Received Date])

where vYesdate is variable, "Let Date(Today()-1,'YYYY-MM-DD')"

its bit strange 4 days back it was returning Yesterday's date now its returning -

Could any one help me to fix this :-(

Thank you in advance.

Regards,

Rekha J. V.

5 Replies
omarbensalem
Esteemed Contributor

Re: Set Expression

Maybe you have more than one received date for your selected date(yesterday)

Try :

Date(aggr(Max({$<[Received Date]={"$(vYesdate)"}>}[Received Date]),[Received Date]))

rekha_jv
New Contributor III

Re: Set Expression

No Still getting "-"

shraddha_g
Honored Contributor III

Re: Set Expression

can you check data in [Received Date] whether It includes yesterday's date.

Also check what today()-1 is returning?

MVP
MVP

Re: Set Expression

vYesDate will calculate to yesterday in relation to the "day of last finished data load". It will not be yesterday as of your current clock.

Today() without a parameter is the same as Today(0):

http://help.qlik.com/en-US/sense/November2017/Subsystems/Hub/Content/Scripting/DateAndTimeFunctions/...

If you want it to be today according to clocktime your will have to use Today(1) or Today(2) depending on where you do the actual calculation. In the load script or in the app.

MVP
MVP

Re: Set Expression

I would do like this:

Only({$<[Received Date]={"=Date(Today()-1,'YYYY-MM-DD')"}>}[Received Date])


or


SET vYesDate = Date(Today()-1,'YYYY-MM-DD') ;