Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a problem displaying out the last month. When a user select April 2013, I will have two expression that show April 2013 and April 2012. It will take the current month.
This is my expression for both of them
Label : Only(Month) and Only(Year)-1
Sum(
{$<Line_Code={'ADV','MAL','AMT'},Derived_Status={'IMPT','EXPT'},Derived_Container_Class_Name={'LADEN'},Month_Id={"<= $(=Max(Month_Id))"},Year ={$(=Max(Year)-1)},Month=, Month_Year = >}TEU
=
ONLY(Month) & ' ' & ONLY(Year
)
sum({<Line_Code={'ADV','MAL','AMT'},Derived_Status={'IMPT','EXPT'},Derived_Container_Class_Name={'LADEN'},Month_Id={$(=Max(Month_Id))},Year = ,Month=, Month_Year = >} TEU)
For Only(Month) and Only(Year), current year. i managed to get the value correctly,
for Only(Month) and Only(Year)-1, I get a YTD of Jan - Apr 2012 instead. I am actuallly looking for Apr 12 current month instead.
why is this so, thanks
ok i will try,
but anywhere this is my code,
Sum(
{$<Line_Code={'ADV','MAL','AMT'},Derived_Status={'IMPT','EXPT'},Derived_Container_Class_Name={'LADEN'},Month_Id={" $(=Max(Month_Id))"},Year ={$(=Max(Year)-1)},Month=, Month_Year = >}TEU
/
Aggr(
NODISTINCT
Sum(
{<Line_Code={'ADV','MAL','AMT'},Derived_Status={'IMPT','EXPT'},Derived_Container_Class_Name={'LADEN'},Month_Id={"$(=Mac(Month_Id))"},Year ={$(=Max(Year)-1)}, Month=, Month_Year = >}
TEU),Year
)
)
ok i will try,
but anywhere this is my code,
Sum(
{$<Line_Code={'ADV','MAL','AMT'},Derived_Status={'IMPT','EXPT'},Derived_Container_Class_Name={'LADEN'},Month_Id={" $(=Max(Month_Id))"},Year ={$(=Max(Year)-1)},Month=, Month_Year = >}TEU
/
Aggr(
NODISTINCT
Sum(
{<Line_Code={'ADV','MAL','AMT'},Derived_Status={'IMPT','EXPT'},Derived_Container_Class_Name={'LADEN'},Month_Id={"$(=Mac(Month_Id))"},Year ={$(=Max(Year)-1)}, Month=, Month_Year = >}
TEU),Year
)
)
Hi,
Look on you expression, found something wrong
n1ef5ng1 wrote:
ok i will try,
but anywhere this is my code,
Sum(
{$<Line_Code={'ADV','MAL','AMT'},Derived_Status={'IMPT','EXPT'},Derived_Container_Class_Name={'LADEN'},Month_Id={" $(=Max(Month_Id))"},Year ={$(=Max(Year)-1)},Month=, Month_Year = >}TEU ) // Missing bracket/
Aggr(
NODISTINCT
Sum(
{<Line_Code={'ADV','MAL','AMT'},Derived_Status={'IMPT','EXPT'},Derived_Container_Class_Name={'LADEN'},Month_Id={"$(=Mac(Month_Id))"},Year ={$(=Max(Year)-1)}, Month=, Month_Year = >}
TEU),Year
)
) // Should take it out
Now let try:
Sum({$<Line_Code={'ADV','MAL','AMT'},Derived_Status={'IMPT','EXPT'},Derived_Container_Class_Name={'LADEN'},Month_Id={$(=Max(Month_Id))},Year ={$(=Max(Year)-1)},Month=, Month_Year = >} TEU)
/
Aggr(
NODISTINCT
Sum(
{<Line_Code={'ADV','MAL','AMT'},Derived_Status={'IMPT','EXPT'},Derived_Container_Class_Name= {'LADEN'},Month_Id={$(=Max(Month_Id))},Year ={$(=Max(Year)-1)}, Month=, Month_Year = >} TEU)
,Year)
Regards,
Sokkorn
the whole expression is invalid when i paste the code that you gave.
have u tried decomposing your expressions into short one first
like showing the Sum part and Aggr part in separate expressions, removing part of the set conditions?
can u still get the expected result?
i tried, sum was correct. Aggr actually display YTD for 2013 and not last year, 2012
if u want lastyear current month and current date
u can write like in ur expression
year(today())-1,month(today()),day(today())
this will give lastyear,currentmonth, currentdate
eg::
22:7:2017 instead of this it will give
2:7:2012