Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want an expression like this.
=sum({<[Month] = {"April"}, Year = {"2012-13"}>}Data)
This works correctly but now I want month and year selected by the user from a list. I could have done it with GetFeildSelections() but I am using alternate States and GetFeildSelections() does not work with alternate states. So I used maxstring() function.
Having my state name as 'new', I did it as follows:
=sum({<[Month] = maxstring({[new]} [Month]),[Year] = maxstring({[new] [Year]})>}Data)
=sum({<[Month] = maxstring({[new]} [Month])>*<[Year] = maxstring({[new] [Year]})>}Data)
But its showing "error in set modifier element function name".
Then I tried creating variables for Month and Year as:
vMonth = maxstring({[new]} [Month]) and
vYear = maxstring({[new]} [Year])
still no correct output.
Anybody has a solution for this?
Hi ,
Try below expression
=sum({<[Month] = {'$(=maxstring({[new]} [Month]))'},[Year] = {'$(=maxstring({[new]}[Year]))'}>}Data)
=sum({<[Month] = {'$(=maxstring({[new]} [Month]))'}>*<{'$(=maxstring({[new]}[Year]))'}>}Data)
Please post a sample app so that we can have a look to help you in a better way
Hi,
Instead of using MaxString() You can use Only Max function
Like this,
=sum({<[Month] ={"=max([Month]"},[Year] ={"=max([Year])"}>}Data)
Regards,
Hi Mansi,
Try this approach. Declare variables for your month and year.
e.g. vMonthnew =concat({new}Month)
vYearnew =concat({new} Year)
Now use the variable directly in the set analysis. That is more readable as well. You don't need maxstring.
Hi,
First of all check your variable values using a text box.. see if the values are desired or not.
if all is well then you can try below expression:
=sum({<[Month] = $(vMonth ),[Year] = $(vYear )>}Data)
HTH
Sushil
Hi ,
Try below expression
=sum({<[Month] = {'$(=maxstring({[new]} [Month]))'},[Year] = {'$(=maxstring({[new]}[Year]))'}>}Data)
=sum({<[Month] = {'$(=maxstring({[new]} [Month]))'}>*<{'$(=maxstring({[new]}[Year]))'}>}Data)
Hello Mansi,
No need to use maxstring here, You can just try with this
=Sum({<Month ={"$(MaxMonth)"},Year ={"$(MaxYear)"}>} Data)
Hope it will help you
- Regards,
Vishal Waghole
Hello Mansi,
I forgate to tell you that, you have to declared two variable.
MaxMonth = Date(Max(Month(DateField)),'MMM')
MaxYear = Date(Max(Year(DateField)),'YYYY')
then use above expression.
I checked for my variables, they are working fine except that when nothing is selected - I get output as the last value in my listbox. What can be done to correct this?
And for the expression you gave, I am getting some output instead of the earlier one where i used to get zero but it is not the desired result.
Hi Mansi,
Post your sample application for better resolution.
~Sushil