Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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..
HI
Try like this using SEt analysis
sum({<Order_Date={'$(=Date(max(Order_Date)))'}>} Order_Qty)
Hope this helps you.
Regards,
jagan.
HI
Try like this using SEt analysis
sum({<Order_Date={'$(=Date(max(Order_Date)))'}>} Order_Qty)
Hope this helps you.
Regards,
jagan.
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
Try what Jagan and Vipin suggested,
also make sure format should match as max() returns a integer value not a formatted date like ORDERDate