Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I'm trying to do something that seems relatively simple but i cannot get it to work. I want to calculate the sum of a value only for the maximum year and month of the current selection. This is the expression i'm using,
sum({$<YEAR = {$(=max(YEAR))}, MONTH = {$(=max(MONTH))}>} Stock_Value_CY)
I;ve broken the expression in its compnenets and although the expression for max year works, the expression for max month doesn't.
Anybody can see what i;m doing wrong?
create an extra field in your script as
num(Month(Yourdatefield)) as Month#,
and reload the application and write your expression as
sum({$<YEAR = {$(=max(YEAR))}, Month# = {$(=max(Month#))}>} Stock_Value_CY)
hope it will work
Hi,
Try in ""
like
sum({$<YEAR = {"$(=max(YEAR))"}, MONTH = {"$(=max(MONTH))"}>} Stock_Value_CY)
Regards
Can you share your sample apps please?
Hi Petrovic,
Your expression looks good , i think some issue with month field.Can you please share your app?
Try =max(MONTH) in a textbox and see what output you are getting?
Regards
KC
I've already tried this syntax, it doesn't work.
I've done this and it gives me back the value i want. it is numeric, integer btw.
I've also tried making the calculations into variables and use the variables but it still doesn;t work. A set analysis expression using the year variable works but the month doesn;t.
I can't upload the app because I'm working on a document taken from the customer which is too big to upload. I do not have a smaller data set.
try this
i guess u made field mistakes
sum({$<YEAR = {$(=max(YEAR))}, MONTH = {$(=max(MONTH))}>} Stock_Value_CY)
do u have the field called month in capital letters?
Hi Vasilis,
=max(year) provide you 2014 , while =max(month) provide you ' - '
Please add the field name from where you are taking the month
e,g =max(month(today()))
These 2 fields are in capital letters and i've tried pasting the actual field names. The result is the same.