Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

stuwannop
Contributor II

Networkdays calculation and date flags

Hi All

Hope you can help.

I have a list of dates in a table running from 1st Jan 2010 to date. I have created a calendar so some dates will be flagged if they fall within the financial year to date, starting 1st April 2013. So what I'm looking at is a table like this:

DateFYTDFlag
31/03/20130
01/04/20131
02/04/20131
etc.etc...
30/06/20131
01/07/2013

0

Now what I need to do is is show the earliest and the latest dates in that range - at this point in time that would be 1st April 2013 and 30th June 2013. I would then calculate the networkdays once I have those two dates. I'm ok with the network days part, but how do I get the "min" and "max" dates based on the FYTD flag equalling 1.

I hope that explains what I'm after - thanks in advance for any help.

Stu

1 Solution

Accepted Solutions
Not applicable

Re: Networkdays calculation and date flags

max({<FYTDFlag={'1'}>} Date)

min({<FYTDFlag={'1'}>} Date)

4 Replies
MVP
MVP

Re: Networkdays calculation and date flags

May be this:

forMax = FirstSoretdValue({<FYTDFlag={'1'}> Date, -Date}

forMIn = FirstSoretdValue({<FYTDFlag={'1'}> Date, Date}    

Thanks.

stuwannop
Contributor II

Re: Networkdays calculation and date flags

Hi tresesco

Thanks for your response. It's pretty close i think but it's not quite working. If I use:

Firstsortedvalue(Date,Date) it will return the earliest(first) date in my data set - great so far. It's only when I enter the set analysis part that it returns a blank.

So, Firstsortedvalue({<FYTDFlag = {'1'}>} Date,Date) does not return a value. Syntax checker says it's ok.

Thoughts?

Stu

Not applicable

Re: Networkdays calculation and date flags

max({<FYTDFlag={'1'}>} Date)

min({<FYTDFlag={'1'}>} Date)

stuwannop
Contributor II

Re: Networkdays calculation and date flags

awesome - thanks Alex - I don't know what I was doing wrong but I'd got in my head that Max and Min don't work with set analysis.

Cheers

Stu

Community Browser