Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have an expression with an if statement and multiple dimensions which shows me the amount of days the payment of an outstanding invoice was due. I have two created Variables (Begin and End) in a slider/input box.
=if
(sum({<Year=,Month=>} OutstandingAmount)<>0 AND (today() - only(InvoiceExpirationDate)>0),
(today() - only(InvoiceExpirationDate)))
This works fine, but how can I calculate the Max value of this function?
Name X, oldest invoice = xx/xx/xx, this = 100 days
Name Y, oldest invoice = xx/xx/xx, this = 50 days
Name Z, oldest invoice = xx/xx/xx, this = 30 days
I should get the result:
Name X, 100 days
Can anybody help me?
Thanks in advance
HI,If expression is correct then Max (Your expression ) should give 100 I guess..
if u want Name then just try something like:
=Firstsortedvalue(Name,-Your expression)..
Try like this it should work:)
Sachin
Try like below
At script level:
Load
Name,
OldInvoicedate,
Interval(Today()-OldInvoicedate,'DD') AS No.ofDays
FROM table1;
Now if you want to display Name then use this
FirstSortedValue(Name,-Aggr(sum(No.ofDays),Name))
No it does not. Just putting Max() around it gives me an "Error in expression" in the expression window...
Or Try This,
FirstSortedValue(
Name,
-Aggr( IF( (sum({<Year=,Month=>} OutstandingAmount)) <>0
AND (Interval(today() - InvoiceExpirationDate ,'DD')>0), Interval(today() - InvoiceExpirationDate ,'DD') )),Name)
)
Is there an option without having to touch the script? I am not allowed to change anything in the script...
Please share your application, the above expression you can write only in charts not in Script