Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

putting two IF clauses

=count(distinct(if(Release = '2017' or Release = '2018',Marketing_Name)))

Hi, above expression is working fine.

but I want the calculation to be done only based on data of past 30 days.

In this case, I want to add a condition where it says    if(Date > Max(Date)-30) something like that.

can I include this into the expression?

Thank you!

3 Replies
vishsaggi
Champion III
Champion III

Am not sure just Try this ?

=count(DISTINCT {< Release = {'2017','2018'}, Date = { "$(= '>=' & Date(Max(Date)-30, 'DD/MM/YYYY'))"} >} Marketing_Name)

Change the date format if your Date field is different.

sunny_talwar

I would also suggest adding <= in there just because if someone select another Date, the expression won't be restricted to just 30 days.

=Count(DISTINCT {<Release = {'2017','2018'}, Date = {"$(= '>=' & Date(Max(Date)-30, 'DD/MM/YYYY') & '<=' & Date(Max(Date), 'DD/MM/YYYY'))"} >} Marketing_Name)

vishsaggi
Champion III
Champion III

Ohh I missed that. Got you. Thanks Sunny.