Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Compare the previous year Data

periodcategorymoneycountmmPMAPM
Currentperiod-2CAT50000100500010

CurrentPeriod-1

CAT4000012060006.6
CurrentPeriod-0CAT90000500800011.25

Until MM the data is coming from directly table. PM definition is money/mm . Now i need to compare the PM from current period to previous time periods. So i need to populate the values only in CurrentPeriod-1 and   CurrentPeriod-0 sections.  how to write the expression dynamically . 


APM= (6.6-10)/10*100


Thanks,


Kumar


5 Replies
dplr-rn
Partner - Master III
Partner - Master III

Did you try above function?

taking PM expression with an example Sum(PM)

so your APM expression would be (Sum(PM) - above(Sum(PM)) )/above(Sum(PM))

see below article for more details

The Above Function

Anonymous
Not applicable
Author

SUM(MONEY)/SUM(MM)-ABOVE(SUM(MONEY)/SUM(MM))/ABOVE(SUM(MONEY)/SUM(MM))

dplr-rn
Partner - Master III
Partner - Master III

Watch you brackets it should be (a-b)/b

right now its a-b/b

let me know if it works. Mark as answered it it does

Anonymous
Not applicable
Author

Ranjith,

If i don't have category column in main table view the formula works fine. Because in original data category column have different types like CAT1,CAT2.  the formula is working for single dimension only. Thanks For your help !

Thanks,

Kumar

dplr-rn
Partner - Master III
Partner - Master III

number of dimensions shouldnt matter.

are you using a pivot table where one of the dimensions have been pivoted to a column? if so use before  function

Missing Manual - Before() and After()