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: 
Anonymous
Not applicable

Compare two Years which each other

Hi!

I'm very new to QlikView and i would now like to Compare Data of one Month in a Fiscal Year with the same Month one year before.

If there is any other selection this should also be considered.

How can i do that?

7 Replies
Janneke
Creator
Creator

Hi Andreas,

You can use set analysis in two expressions:

=sum({$<Month={SelectedMonth},Year={ThisYear}>Value)

=sum({$<Month={SelectedMonth},Year={PreviousYear}>Value)

Greetings, Janneke.

awhitfield
Partner - Champion
Partner - Champion

What date fields do you have in your qvw?

Andy

Not applicable
Author

in modifer

=sum({$1<month={jan}>}amount)

=sumn({1<month={jan}>amount)

Anonymous
Not applicable
Author

Hi,

i have the following Fields in my QVW

CalenderMonth,
CalenderYear,
CalenderYearmonth,
FiscalYear,
F
iscalMonth,
FiscalYearMonth,
PrevFY,
PrevCalenderYear,
NameofMonth,
Workingdays

Janneke
Creator
Creator

Hi Andreas,

Your expression for the month this fiscal year could be:

=sum({$<FiscalYear={2015},FiscalMonth={02}>}[data_to_compare])

Your expression for the month last fiscal year could be:

=sum({$<FiscalYear={2014},FiscalMonth={02}>}[data_to_compare])

Option: You can have the years you want to compare in variables. Then, instead of {2015} and {2014} you can use {'$(variableYear)'} and {'$(variableYearMinus1)'} or {'$(=variableYear-1)'}.

Good luck!

Janneke.

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Create a straight table with one dimension = FiscalMonth and two expressions like:

=sum({<FiscalYear = {$(=Max(FiscalYear))}>} Data)

=sum({<FiscalYear = {$(=Max(FiscalYear) - 1)}>} Data)


Replace the dummy field Data in the examples with the one you want to aggregate.


Best,


Peter

sagarkharpude
Creator III
Creator III

Previous Year

Sum({<Year = {'$(=Max(Year)-1)'},Month = {'$(=Max(Month))'}>}Value)        

And

Current Year

Sum({<Year = {'$(=Max(Year))'},Month = {'$(=Max(Month))'}>}Value