Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
london1980
New Contributor

Order_Date=max(Order_Date) gives an error in formula

Hi All,

I'm trying to write a conditional sum function.

When I write it like this, it works.

sum(if(Order_Date='18/11/2015',Order_Qty)

But if I want to make the chosen date dynamic as the most recent date in the table, where I'm using max(Order_Date), it gives an error:

Error in Expression

sum(if(Order_Date=max(Order_Date),Order_Qty)

Any idea how to fix this?

thanks..

1 Solution

Accepted Solutions
MVP
MVP

Re: Order_Date=max(Order_Date) gives an error in formula

HI

Try like this using SEt analysis

sum({<Order_Date={'$(=Date(max(Order_Date)))'}>} Order_Qty)

Hope this helps you.

Regards,

jagan.

3 Replies
MVP
MVP

Re: Order_Date=max(Order_Date) gives an error in formula

HI

Try like this using SEt analysis

sum({<Order_Date={'$(=Date(max(Order_Date)))'}>} Order_Qty)

Hope this helps you.

Regards,

jagan.

vipin_mishra479
Contributor II

Re: Order_Date=max(Order_Date) gives an error in formula

Hi Maham

there multiple way you find this answer what ever Jagan has mention this is the one way and another way is

create a variable like

vMaxdate = Date(max(Order_Date),'DD/MM/YYYY')

and use

sum({<Order_Date = {'$(vMaxdate )'}>}Order_Qty)

Try this may be helpful for you

vipin

balrajahlawat
Esteemed Contributor

Re: Order_Date=max(Order_Date) gives an error in formula

Try what Jagan and Vipin suggested,

also make sure format should match as max() returns a integer value not a formatted date like ORDERDate

Community Browser