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

What is wrong?

Hi Experts,

I have a very simple set analyis which is not working.

=Count({$<%ERDAT ={$(=max(%ERDAT))}>} Delivery.MATKL)

Can you please let me know what is wrong with this?

Regards

Jeba

1 Solution

Accepted Solutions
sunny_talwar

Is %ERDAT a date field??? If it is then try this:

=Count({$<[%ERDAT] ={"$(=Date(Max([%ERDAT]), 'DateFieldFormatHere'))"}>} Delivery.MATKL)

View solution in original post

11 Replies
lironbaram
Partner - Master III
Partner - Master III

=Count({$<%ERDAT ={'$(=max(%ERDAT))'}>} Delivery.MATKL)

sunny_talwar

Try this may be:

=Count({$<[%ERDAT] ={"$(=max([%ERDAT]))"}>} Delivery.MATKL)

oknotsen
Master III
Master III

Some symbols and the use of spaces can cause problems.

You can usually bypass these by either not using those or putting the parts with spaces and symbols in square brackets.

May you live in interesting times!
Anonymous
Not applicable
Author

Hi Liron and Sunny,

Still its not working

42224 is the output in the textbox when I use max(%ERDAT).fyi.

Regards

Jeba

sunny_talwar

Is %ERDAT a date field??? If it is then try this:

=Count({$<[%ERDAT] ={"$(=Date(Max([%ERDAT]), 'DateFieldFormatHere'))"}>} Delivery.MATKL)

Anonymous
Not applicable
Author

Hi Sunny,

Still no success.

Count({$<[%ERDAT] ={"$(=Date(Max([%ERDAT]), 'MM/DD/YYYY'))"}>} Delivery.MATKL)

May be you can help me in alternative way if I provide my requrirements.

I am designing a NPrinting report with a straight table.Hence my straight table shoule always have yesterdays data(based on ERDAT).On Mondays it should consider Friday's date.

Is there a easy way other than the above set analysis?

Thanks & Regards

Jeba

Anonymous
Not applicable
Author

if you want last day (friday when max(ERDAT)=monday) you Need to use

=FirstWorkDate(max(%ERDAT),2)

try this

Count({$<[%ERDAT]={'=$(=FirstWorkDate(max(%ERDAT),2))'}>}Delivery.MATKL

Anonymous
Not applicable
Author

Hi Rudolf,

Thanks for the guidance.

Initially I was trying the same expression and it didn't worked.

Now I am trying to achive the count based on maxdate and then using the Firstwork date.

Unfortunately both are not working

Regards

Jeba

Anonymous
Not applicable
Author

Hi,

Maybe try this:

=Count({$<[%ERDAT] ={"$(=Date(Max([%ERDAT]),'MM/DD/YYYY'))"}>} Delivery.MATKL)