Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

ruma_barman
New Contributor III

Sum of previous sale not working with selection of one month

Hi All,

Can anybody please help?

I have an expression like

(sum({<Link_Date={'$(vMaxDate)'}>}Sales)-sum({<Link_Date={'$(vPreviousDate)'}>}Sales))/sum({<Link_Date={'$(vPreviousDate)'}>}Sales) where vMax and vPreviousDate are variables defined respectively as =Date(Max(Link_Date),'DD/MM/YYYY') and =Date(monthend(Addmonths(max(Link_Date),-1)),'DD/MM/YYYY').


This is working when no monthname is selected ,whenever one single month is selected it will show sum as 0 but will work when two month name is selected.



Thanks,

Ruma

5 Replies

Re: Sum of previous sale not working with selection of one month

What is your monthname field called? If it is called monthname, then try this

(Sum({<Link_Date={'$(vMaxDate)'}>}Sales) - Sum({<Link_Date={'$(vPreviousDate)'}, monthname>}Sales))/Sum({<Link_Date={'$(vPreviousDate)'}, monthname>}Sales)

ruma_barman
New Contributor III

Re: Sum of previous sale not working with selection of one month

Thanks Sunny.

Regards,

Ruma

ruma_barman
New Contributor III

Re: Sum of previous sale not working with selection of one month

Hi Sunny,

If I try with fiscal quarter year,it's not working.Is anything else I need to do?

(Sum({<Link_Date={">=$(=Date(QuarterStart(vMaxDate,0),'DD/MM/YYYY'))<=$(=Date(quarterEnd(vMaxDate,0),'DD/MM/YYYY'))"} >} Sales)

-

Sum({<[Fiscal Quarter Year], Link_Date={">=$(=Date(QuarterStart(vMaxDate,-1),'DD/MM/YYYY'))<=$(=Date(quarterEnd(vMaxDate,-1),'DD/MM/YYYY'))"} >}Sales))

/ Sum({<[Fiscal Quarter Year], Link_Date={">=$(=Date(QuarterStart(vMaxDate,-1),'DD/MM/YYYY'))<=$(=Date(quarterEnd(vMaxDate,-1),'DD/MM/YYYY'))"} >} Sales)

Regards,

Ruma

Re: Sum of previous sale not working with selection of one month

When you say it is not working, do you see inconsistent result? see errors?

ruma_barman
New Contributor III

Re: Sum of previous sale not working with selection of one month

Sorry for late reply.It's working fine now.

Thanks,

Ruma

Community Browser