Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm trying to declare a variable but keep getting the following message.
Aggregation expressions not allowed in GROUP BY clause
Let vprod6daysago = (sum({$<[Link_Date] = {'07/04/2011'}, [TYPE] = {"COLL"}, [COMPANY_CODE] = {"0017"}>} [VOL]))
I've tried using the AGGR function, aggregating by Link_Date but this also doesnt work any ideas ?
Many thanks
Darrell
You are right in both cases, and yes, using dollar-sign expansion $(), you can use the expression you saved in a variable in any graph or other object.
Regards.
Darrell,
In the script you can't do set analysis or expressions directly
If you want to save the formula as a variable to use in the interfase, change the Let to a Set in your line of code.
If you want to calculate a number for use in the script, you should calculate the number in a load statement using a group by and where statement and then use the peek() function to save the value to a variable.
Regards.
Karl,
Manythanks for the quick response ! - Just to get things clear in my mind.
If i change the let to a set. I take it that I could then reference the variable in an expression such as =sum(vprod6daysago) is that right ?
Alternatively you suggest caculating the value using where and group by. I take it this would be based on a table already resident in my model and the where conditions are really just what I've put in my set analysis formula.
Thanks
Karl,
Just worked it out its = $(vprod6daysago) isn't it ? getting there !
Thanks for your help !
Darrell.
You are right in both cases, and yes, using dollar-sign expansion $(), you can use the expression you saved in a variable in any graph or other object.
Regards.