Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
joey_lutes
Partner - Creator
Partner - Creator

Min Max Date Set Analysis Failure

Something that I would have thought should take me 30 seconds to write has now caused me multiple hours of research and dozens of iterations.

Simple  I need 2 numbers:

Sum({$<ForecastDate = {'$(=Max({1}ForecastDate))'}>}ForecastUtilization)

Sum({$<ForecastDate = {'$(=Min({1}ForecastDate))'}>}ForecastUtilization)

With or without the {1}, adding quotes, removing them, changing around DSE, etc. . . .

SO, I went the variable route:

ReportDateTemp:

  Load

        max(ReportDate) as MaxReportDate,

        min(ReportDate) as MinReportDate,

        max(ForecastDate) as MaxForecastDate,

        min(ForecastDate) as MinForecastDate

Resident ForecastData;

Let vMaxReportDate = Peek('MaxReportDate');

Let vMinReportDate = Peek('MinReportDate');

Let vMinForecastDate = Peek('MinForecastDate');

Let vMaxForecastDate = Peek('MaxForecastDate');

Drop Table ReportDateTemp;

Now I have vMinForecastDate and vMaxForecastDate = both of which display perfectly in a KPI box.

The set analysis is still defeating me.

I've tried:

Sum({$<ForecastDate = {'$(=$(vMinForecastDate))'}>}ForecastUtilization)  //returns 0

Sum({$<ForecastDate = {'$(vMinForecastDate)'}>}ForecastUtilization) //returns 0

I'm sure it's silly.  Hoping so, Help?

1 Solution

Accepted Solutions
sunny_talwar

May be try using Date() function around your variable with the date format of your date field. I think the format mis-match might be causing this

View solution in original post

2 Replies
sunny_talwar

May be try using Date() function around your variable with the date format of your date field. I think the format mis-match might be causing this

joey_lutes
Partner - Creator
Partner - Creator
Author

Yup, that was it.  Glad it was simple.  Live and learn.

Thanks again   You rock!