Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Zurich on Sept 24th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set analysis with date = today() - 1

Hi everybody

I have the field DATE and the field MONEY

i wanna sum(MONEY) in date = today ()-1 (the day before the current day)

how i do this ? i've been trying a few options but they didn't work.

Greetings.

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

If you are doing this in a text box, then something like:

     Sum({<DATE = {'$(=Date(Today() - 1))'} MONEY)

This assumes:

  • DATE is formatted in the default format for your environmment
  • DATE has no time component

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

6 Replies
datanibbler
Champion
Champion

Hi Jeremias,

do you want just the value of yesterday or the sum of all values up until yesterday?

The set_expression for it would be

>>> sum({$<[date] = {"$(= '<=' & Today())"}>} MONEY)

There is in principle a more elegant solution, you can use the parameter "-=" in set_analysis - but then the script_editor doesn't recognize it and will mark all the following code as wrong regardless of whether or not it is correct.

HTH

Best regards,

DataNibbler

MK_QSL
MVP
MVP

SUM({<Date = {'$(=Date(Today()-1))'}>}MONEY)

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

If you are doing this in a text box, then something like:

     Sum({<DATE = {'$(=Date(Today() - 1))'} MONEY)

This assumes:

  • DATE is formatted in the default format for your environmment
  • DATE has no time component

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Or, to eliminate the formatting issues, you can use advanced search:

   Sum({<DATE = {"=DATE=$(=Today() - 1)"} MONEY)


cheers,


Oleg Troyansky

masterssummit.com - take your QlikView skills to the next level!

Not applicable
Author

Thank you. Everybody said that i should use this expression but it isn't working and i don't know why.

DATE is the field and Date is a function?

thank you

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Post a sample app, and we will show you why it's not working and how to fix it.

Date can be both a field and a function, no problem there.