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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
azmeerrehan
Partner - Creator
Partner - Creator

Previous Month from Today

I have a requirement where I don't have a filter for Year and Month and the date fIeld is 'YYYYMM'.   By default the report shows the data for the current month.  The expression is a set analysis.  Its working fine, until you hit the 1st of the month. So on the1st of Aug for example I still have the data loaded for Jul 31st  and no Aug Data yet.  So the report will show 0 cuz month(T0day()) is Aug and there is no data for Aug.  I am trying to build a logic  like (If(Day(Today()>1, Month(Today()), Month(Today())-1 for previous MOnth.

What am I doing wrong here ??

1 Solution

Accepted Solutions
azmeerrehan
Partner - Creator
Partner - Creator
Author

Doesnt work, but was able to get this work

=If(day(Today())>1,Month(Today()),dATE(Date(Today(),'YYYYMM')-1,'MMM'))

View solution in original post

3 Replies
sunny_talwar

May be this

If(Day(Today()) > 1, Month(Today()), Month(Today() - 1))

azmeerrehan
Partner - Creator
Partner - Creator
Author

Doesnt work, but was able to get this work

=If(day(Today())>1,Month(Today()),dATE(Date(Today(),'YYYYMM')-1,'MMM'))

sunny_talwar

Strange, but okay