Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
amithmurali
Partner - Creator II
Partner - Creator II

How to filter the data

Hi guys,

Suppose in my table,

i want to show comparison of this year data with the previous year data. when i compare it in  a gauge. its taking the data for the entire previous year and comparing with the 4months of the current year.

i have data for the entire year 2014 and till may for 2015. when i compare it should make a division like "2015 data till may / 2014 data till may".

1 Solution

Accepted Solutions
amithmurali
Partner - Creator II
Partner - Creator II
Author

vMaxYear:   =Year(Max(Date))

vPriorYear     =(year(Max(Date))-1)

vMaxMonth     =max({<Year={'$(vMaxYear)'}>}Month)

vMinMonth     =min({<Year={'$(vMaxYear)'}>}Month)

The set analysis that i made is

sum({<Year={'$(vMaxYear)'},Month={'>=$(vMinMonth)<=$(vMaxMonth)'}>}Value)/

sum({<Year={'$(vPriorYear)'},Month={'>=$(vMinMonth)<=$(vMaxMonth)'}>}Value)

View solution in original post

5 Replies
MayilVahanan

Hi

Try like this

vMaxMonth  <-- its store the May month value (i.e. Max month value of the current year)

Sum({<Year = {$(=max(Year))}, Month = {"<=$(vMaxMonth)"}>}Sales) /

Sum({<Year = {$(=max(Year)-1)}, Month = {"<=$(vMaxMonth)"}>}Sales)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
amithmurali
Partner - Creator II
Partner - Creator II
Author

Can you explain in detail. i am new to qlikview.

sujeetsingh
Master III
Master III

Just try to study all about Set Analysis

amithmurali
Partner - Creator II
Partner - Creator II
Author

vMaxYear:   =Year(Max(Date))

vPriorYear     =(year(Max(Date))-1)

vMaxMonth     =max({<Year={'$(vMaxYear)'}>}Month)

vMinMonth     =min({<Year={'$(vMaxYear)'}>}Month)

The set analysis that i made is

sum({<Year={'$(vMaxYear)'},Month={'>=$(vMinMonth)<=$(vMaxMonth)'}>}Value)/

sum({<Year={'$(vPriorYear)'},Month={'>=$(vMinMonth)<=$(vMaxMonth)'}>}Value)