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: 
Akina0929
Creator
Creator

how to display date field values conditionally?

Hi,

I have one date field,I want to display in that field

if the date field value is lastmonth, it has to display same date

else condition '-'

3 Replies
sushil353
Master II
Master II

Try this:

if(Month(DateField) = Month(Addmonths(today(),-1),DateFiled,null())

Akina0929
Creator
Creator
Author

Hi sushil,

         it,s showing error.Capture.JPG

rahulpawarb
Specialist III
Specialist III

Hello AB,

Month function takes 1 parameter. Corrected the expression to add closing bracket for month function.

//Old Code:

=if(Month(saledate) = Month(AddMonths(Today(),-1), saledate, null())

//New Code:

=if(Month(saledate) = Month(AddMonths(Today(),-1)), saledate, null())

Hope this will be helpful.

Regards!

Rahul