Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
yogitamehta10
Creator
Creator

to calculate yesterdays date

Hi All,

I have  a set analysis,in which i have defined

count({<NO={'Ba'},STATUS={'CLOSED'},Year={$(=max(Year))},[ MONTH]={$(=max([ MONTH]))},

[work_DATE] = {"$(=Date(Max([workDATE])-1, 'DD/MM/YYYY'))"},Month_Year=,Quarter=>}SEQ_NO)

now i want to calculate  max date of [work_DATE] -1 ( that will give me yesterdays date and  there is one conditiion in that max([work_DATE]) where NO=Ba,

how should i give this condition in set or any other method.

Please advise

7 Replies
neelamsaroha157
Specialist II
Specialist II

Didn't get what you meant by "i want to calculate  max date of [work_DATE] -1"

yogitamehta10
Creator
Creator
Author

means  iwa nt to calculate date that is one less then maximum of work date

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Your expression is almost correct, you just son't need double quotes:

count({<NO={'Ba'},STATUS={'CLOSED'},Year={$(=max(Year))},[ MONTH]={$(=max([ MONTH]))},

[work_DATE] = {$(=Date(Max([workDATE])-1, 'DD/MM/YYYY'))},Month_Year=,Quarter=>}SEQ_NO)

This expression, however, assumes that the work_DATE is formatted as 'DD/MM/YYYY and that the field MONTH is formatted as a number (not a dual Month). Having said that, what's the point in selecting specific Year and Month if you are selecting Date as the yesterday's date?

Another caveat is the impact of the current selections. Max(Date) returns the max available date, In order to select the maximum possible date in the whole app, you should use

max({1} Date)

cheers,

Oleg Troyansky

Learn advanced Qlik techniques in my book QlikView Your Business

yogitamehta10
Creator
Creator
Author

HI ,

Thsi si not working , i do not want mamum date , i want maximum date where NO={'Ba'} this will tell me for this dashboard which is Ba , maximum date for this is . wahta i want.

yes you are right i can remove maximum year and month.

what should be my final expression.

tresesco
MVP
MVP

yogita mehta wrote:

.. i want maximum date where NO={'Ba'} this will tell me for this dashboard which is Ba , maximum date for this is .

For that you may try like:

[work_DATE] = {$(=Date(Max( {< NO={'Ba'}>} [workDATE])-1, 'DD/MM/YYYY'))

yogitamehta10
Creator
Creator
Author

SO my final expression should be

count({<NO={'Ba'},STATUS={'OPEN'},

[work_DATE] = {$(=Date(Max( {< NO={'Ba'}>} [workDATE])-1, 'DD/MM/YYYY'))SEQ_NO)

yogitamehta10
Creator
Creator
Author

but this is not giving me any record