Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Add previous 2 months values on selection of particular month

Hi Experts

I want values of previous  2 months  on selection of particular month.It should group by month wise.

On clear selection also it should display last 3 months which i got from following expression:

(Aggr(Sum({< link_Date={">=$(vLast3Months)<=$(vCurrentDate)"}, [Fiscal Year]=, [Fiscal Month]= >}

Sale),[Fiscal Year], [Fiscal Month], link_Dealer))


For example on selection i want , If i select jan 2015 then it should dislpay data of jan 2015,dec 2014,nov 2014

on the selection jan 2015 .


plzz give the solution fast its urgent. Im getting stuk in this problem.


Thanks in advance.

23 Replies
Not applicable
Author

But on selection of jan 2015 i should get values of dec 2014 and nov 2014  but im getting values of 2015 dec and nov

how should i got it?

sunny_talwar

So you are seeing Jan 2015, Dec 2015 and Nov 2015 when you select Jan 2015???

Not applicable
Author

yes.How should i get data of dec 2014 ,nov 2014 on selection of jan 2015

Not applicable
Author

Hi Kajal,

Try like this

Dimension:

Month(link_Date) & Year (link_Date)

Expression:

Sum({$<link_Date={">=$(vLast3Months)<=$(vCurrentDate)"}>}Sale)

where

vLast3Months=AddMonths(Max(link_Date),-3)

vCurrentDate=Max(link_Date)



Regards

Harsha


sunny_talwar

When you put this -> $(vLast3Months) in a text box, what do you see?

Not applicable
Author

Im getting 1-11-2014 in text object on selection of jan 2015

Not applicable
Author

Do you have any solution for this?

Not applicable
Author

HI,

I tried your solution .im getting 2015 dec and 2014 nov but it showing values of 2015 only.

I dont have any data for 2014 so it should display null on selection of jan 2015.

Not applicable
Author

Sorry im getting 2014 dec n nov .Typing mistake.Do u have any suggesions on this problm?

sunny_talwar

I am not sure why it is showing Dec 2015 and Nov 2015 when we have  >=1/11/2014 <=31/1/2015

Can you check your variable and expression to make sure that you haven't missed anything?