Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

Min Function not working with Date

Hello Guys , I Have a small issue in my dashboard.. In the straight table I am trying to add Min function for Date.

My requirement is like this.. Each order may have multiple invoices. I am trying to show the 1st invoice for each order.

So i am trying to give the calculated dimension like this - If( Date = Min(Date) , Date). Also giving "Suppress when value is null" for that particular dimension.

So, the date here is the invoice date, So when I use the above statement I would expect it to show only the 1st invoice for every order.

But instead it is just giving "error in calculated dimension".. Can you guys please help me here..

This one is so simple and yet so stressful by not working..

Any help here is highly appreciated.. Thank You.

1 Solution

Accepted Solutions
Highlighted
MVP
MVP

Ah, I missed that you are using multiple dimensions, Order and Invoice:

=Aggr( If( Date = Min(TOTAL<Order> Date), Date), Order, Date)

View solution in original post

10 Replies
Highlighted

Try this:

If(Date = Min(TOTAL Date) , Date)

Highlighted
Contributor III
Contributor III

Thank you for the reply.. But its giving out null all thru.

Highlighted

Is your DATE field correctly loaded as a dual field?

If you put a list box on your DATE field are the values left justified indicating they are text, or right justified indicating a dual field.

Min() returns  the numeric minimum and should be used on date fields. Minstring() should be used on text data.

This blog has more details on dates in Qlikview. Get the Dates Right

Highlighted

I guess you would then need to check if you date is actually read as date by QlikView or not -> Why don’t my dates work?

Highlighted
Contributor III
Contributor III

Yes have tried multiple ways.. Like with Min(Num(Date))..

But when loading the date i a doing it like this - Date(Floor(Date))

Highlighted

May be give this a shot:

Aggr(Only({1<Date = {'$(=Date(Min(Date)))'}>} Date), Date)

Highlighted
MVP
MVP

maahivee wrote:

Yes have tried multiple ways.. Like with Min(Num(Date))..

But when loading the date i a doing it like this - Date(Floor(Date))

Ok, but can you confirm that your dates have a numeric representation?

Do you get numbers when you are creating a table chart with dimension Date and expression =Num(Date)

?

Highlighted
MVP
MVP

Ah, I missed that you are using multiple dimensions, Order and Invoice:

=Aggr( If( Date = Min(TOTAL<Order> Date), Date), Order, Date)

View solution in original post

Highlighted
Contributor III
Contributor III

Thank you all guys for all your time and effort..