Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

jebamalai
Valued Contributor

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

Tags (1)
1 Solution

Accepted Solutions

Re: What is wrong?

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

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

11 Replies
lironbaram
Honored Contributor II

Re: What is wrong?

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

Re: What is wrong?

Try this may be:

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

oknotsen
Honored Contributor III

Re: What is wrong?

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!
jebamalai
Valued Contributor

Re: What is wrong?

Hi Liron and Sunny,

Still its not working

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

Regards

Jeba

Re: What is wrong?

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

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

jebamalai
Valued Contributor

Re: What is wrong?

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

hrlinder
Honored Contributor

Re: What is wrong?

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

jebamalai
Valued Contributor

Re: What is wrong?

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

neetha_p
Honored Contributor

Re: What is wrong?

Hi,

Maybe try this:

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

Community Browser