Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

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
stephen-a_redmo
Valued Contributor II

Limit numbers os items for 6 month ago

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

Limit numbers os items for 6 month ago

thank you. i'll do

Not applicable

Limit numbers os items for 6 month ago

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?

Highlighted
stephen-a_redmo
Valued Contributor II

Limit numbers os items for 6 month ago

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