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: 
Not applicable

How to use date functions?

Hi there,

if I want to capture last year or last month or last week or last 10 days result, how to use data functions in script?

thank you in advance!

3 Replies
tresesco
MVP
MVP

Perhaps you have to make it a bit more clear about your requirement.

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Your best bet is probably Set Analysis, something like:

=sum({<MyDate={">=$(=MonthStart(AddMonths(max(MyDate), -1)))"}>}MyValue)

or

=sum({<MyDate={">=$(=Date(max(MyDate) - 10))"}>}MyValue)


But, point in time reporting, especially matching dates in Set Analysis can be slightly tricky, so I would suggest looking at a few examples.  This is one I have put together that you may find useful:


QlikView App: Set Analysis - Prior Period Comparison


Cheers,

Steve

its_anandrjs
Champion III
Champion III

You have to go for SET analysis or you can use the variables with the data functions for obtain the last date values.