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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Controller1
Contributor III
Contributor III

Day from Yesterday

Hello,

I have a problem. My formula works for today but not for yesterday. I have already inserted -1 after day but it doesn't show me anything.
What have I done wrong?

This is my formula that works

Sum({<Tag={'$(=max(Tag))'}>}[nicht abgerechnet])

Why doesn't it work?

Sum({<Tag={'$(=max(Tag-1))'}>}[nicht abgerechnet])

Labels (1)
3 Replies
marcus_sommer

Try it in this way: Sum({<Tag={"$(=max(Tag)-1)"}>} [nicht abgerechnet])

Controller1
Contributor III
Contributor III
Author

we tried with way

=if(ISNULL( GetFieldSelections([Tag])), Sum ( {$<[Tag] = {"$(=date(today()-1,'DD.MM.YYYY'))"}>} [nicht abgerechnet] ), sum({<Tag={'$(=Date(getfieldselections(Tag) -1))'}>} [nicht abgerechnet]) )

 

your way didnt´t show me the right figures. I don´t no why but thanks for your help

 

marcus_sommer

It wasn't obvious that your [Tag] isn't a day else a formatted date. Try it again with:

Sum({<Tag={"$(=date(max(Tag)-1))"}>} [nicht abgerechnet])

Each calculation on a field like the max() or just Field - 1 removed any formatting and returned a pure number. But within the Set Analysis the comparing happens on a string-level and therefore including the formatting which is now not matching anymore. Exceptions are a >= <= comparing which goes to the numeric values behind any format.