Qlik Community

Qlik Education Discussions

Discussion Board for collaboration related to Qlik Education.

stephenedberkg
Contributor II

Show next 21 month sales

if i select the 2013  jan mean i want to show next 21 month sales values in line chart

13 Replies
jpenuliar
Valued Contributor III

Re: Show next 21 month sales

You will have a Start Date and End Date:

Example: StartDate = Today()

               EndDate = Month(AddMonths(Today(),21))

jpenuliar
Valued Contributor III

Re: Show next 21 month sales

If you save your Date range in variables, your expression can be:

=Sum({<Date_Field = {'>=$(=date($(vStartDate)))<=$(=date($(vEndDate)))'}>}Sales)

stephenedberkg
Contributor II

Re: Show next 21 month sales

Thank you for your reply

i want this calculation in dimension. i have master calender  also

jpenuliar
Valued Contributor III

Re: Show next 21 month sales

you can use your Date Range to a "Select in Field" action, making it visible in your current selection box, or you can use it for your calculated Dimension.

jpenuliar
Valued Contributor III

Re: Show next 21 month sales

Maybe something like below for your calculated dimension

=if(Date >= vStart_Date and Date <= vEnd_Date,Date)

stephenedberkg
Contributor II

Re: Show next 21 month sales

Dear Jonathan Penulier,

i want to show the next 21 month from current month.can i change is it in script?

jpenuliar
Valued Contributor III

Re: Show next 21 month sales

in the load Script? of course you can,

add a Where clause on your Date field with your Date range.

stephenedberkg
Contributor II

Re: Show next 21 month sales

can you tell that syntax of this

jpenuliar
Valued Contributor III

Re: Show next 21 month sales

When you say Current month,  you mean this month correct? so I am thinking, what data can you load from your source for the next 21 months?

You see my logic there, how can you load for example the next 21 months transactions if it hasn't happen yet?

Community Browser