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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
ramcena306
Creator II
Creator II

Problem with Finding AVG stock values

Hi All,

I am new to QlikVIew, I am facing this issue from past 3 days. I have a chart , where I have to show Avg stock values.

Expression for Avg is :

   =$(v_KPI_Stock_24M_Precalc) /  if(FISCAL_YEAR=vScript_24MStock_FY0,v_NumMonths_CurrentFY,12).


This is working good, but the problem is , it is showing the values upto current month, i.e-March, but I have to show upto completed month. i.e- Feb. For this I have written expression like.


Expression : =$(v_KPI_Stock_24M_Precalc) -if(FISCAL_YEAR=vScript_24MStock_FY0,$(v_KPI_Stock_24M_Precalc_CurrentMonth),0)

/if(FISCAL_YEAR=vScript_24MStock_FY0,v_NumMonths_CurrentFY,12)..

But, This is not working, I have to create [v_KPI_Stock_24M_Precalc_CurrentMonth] this variable to exclude current month from [v_KPI_Stock_24M_Precalc]  this variable.

Attached variables.

loveisfailhhajjalihickush141087mtoarvind1494sureshqvomarbensalemjontydkpitimanshu

Please help me Guys.

11 Replies
sunny_talwar

It might help if you are able to share a sample where you have been doing your stuff...

ramcena306
Creator II
Creator II
Author

Hi sunny, PFA,

variable for 24M_stock, can we create a variable for current month stock like this?

(or) can we exclude latest month in (v_KPI_Stock_24M_Precalc) in this variable ??