Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Limit numbers os items for 6 month ago

Hi, I've got a table of Invoices, of 4 years ago. I want show the last 6 month. I've got a field that is the month-year. How can limit this 6 month.Example: Ene-12,Dic-11,Nov-11,Oct-11,Sep-11,Ago-11.

thank you

4 Replies
stephencredmond
Luminary Alumni
Luminary Alumni

Hi,

I would create a new field from the date which stores the month in YYYYMM format:

    Date(MonthStart(DateField), 'YYYYMM') as YearMonth,

Then it is easier to use this in date arithmetic because you can just do:

   Sum(  { < YearMonth = {">=201108"} > } SalesValue )

Regards,

Stephen

Not applicable
Author

thank you. i'll do

Not applicable
Author

Hi.My expression is:

Sum({<Periodo_Ordenado={">=Periodo_12meses"}>} exp_Contador)  where Periodo_12meses is a variable that I calculated, but not is valid. How can I put a variable in the set expression?

stephencredmond
Luminary Alumni
Luminary Alumni

Hi,

You need to use a dollar expansion:

Sum({<Periodo_Ordenado={">=$(=Periodo_12meses)"}>} exp_Contador)

If you put your expression into a straight table, without a label, the label will show the expression with the dollar expansion already expanded.

Stephen