Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

cancel
Showing results for 
Search instead for 
Did you mean: 
maahivee
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
swuehl
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
sunny_talwar

Try this:

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

maahivee
Contributor III
Contributor III
Author

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

Colin-Albert

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

sunny_talwar

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?

maahivee
Contributor III
Contributor III
Author

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

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

sunny_talwar

May be give this a shot:

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

swuehl
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)

?

swuehl
MVP
MVP

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

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

maahivee
Contributor III
Contributor III
Author

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