Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to compare the current year with previous year
for example
its booked until 201404
i want t show the sales for sum(maxyear) : Jan/Feb/Mar/Apr 2014
and compare it with sum(sales) : Jan/Feb/Mar/Apr 2013
Create a table with those expressions with Month Year as the dimensions, you can then see what is going on.
Add an additional measure to this table of just SUM(Sales), this will give you the amounts you are after in each month.
Try building up the set analysis a bit at a time; e.g. just do the >=YearStart first.
In fact, unless you have future sales values you don't need the <= on the Current Year values.
Set analysis can be quite funny about date formats. You may need to use the Date function to format the output from YearStart and MonthEnd to be in the same format as your Date field.
Hope that helps.
Steve
The expressions that you use is ok for me please check what the Steve suggested to you, may be doing some mistake in set analysis.
you mean inline table?
Just a straight table chart. You could copy your existing one and change the dimension.
now its functioning well but ,if i want to compare 2015 sales with 2017 in same chat .here only 2016 AND 2017 SALES CAN BE SEEN WHEN YEAR DIMENSION WAS TAKEN
You need another expression with AddYears and -2 in there as the parameter.
i have written expression on 2016 label as following :-
=num(sum({< sold_Year = {"$(=Max(sold_Year))"}>} [inv value]/Sales_INR_Unit),'#,##0.0')
now you want me to add another expression?
Sorry, I read it as you wanted to show three years in separate columns. Is it that you want to keep current year ffixed, but change which year you compare to?
If so, you will need to change the years back value to a variable, say vYB and insert that into the expression like this:
=SUM({$<Date = {'>=$(=YearStart(AddYears(Today(),-$(vYB))))<=$(=MonthEnd(AddYears(Today(),-$(vYB))))'}>}Sales)
This will need to be created under Settings \ Variables, and then controlled by a pair of buttons. See this post for details on changing variables with buttons:
https://www.quickintelligence.co.uk/qlikview-buttons/
Hope that helps.