Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everybody,
I have a table with information since Jan 2008, and I want to compare the sales information between months, that means comparisson between each month with same month the year before
for example
Sales (Jan 2009) / Sales (Jan 2008)
Sales (Feb 2009) / Sales (Feb 2008)
Sales (Apr 2009) / Sales (Apr 2008)
I hope you can help me
Regards
Angel,
You are correct that with the MonthYear dimension my formula doesn't work. You have to use Month as the dimension. See the attached example.
You have 2 other options. Use the before() function like Angel mentioned which is a decent solution or in the worse case situation use a dimension monthyear from a table island.
Regards.
Hi,
If use a Year how dimension you can create the expression:
SUM(Sales) / SUM(TOTAL IF(vDate = AddYears(vDate), -1), Sales))
This line just sum the current year of your dimension
"SUM(Sales)"
This Line sum all lines (years), but you filtering just last year
"SUM(TOTAL IF(vDate = AddYears(vDate), -1), Sales))"
One way to do this is create a chart with Month as your dimension, then create three expressions:
sum({$<Year={$(=max(Year))>} Sales)
sum({$<Year={$(=max(Year)-1)>} Sales)
column(1)/column(2)
The current year and past year depend on your selection of year.
Also, please note that AddYears is not an QlikView function.
Regards
Hi Karl,
I tried the example you have posted but with no good results because as months are dimensions for Jan 2009 only takes January Sales into account,
the big problem is that I need month as dimensions and also, users don't want to see sales period by period, they want to see only the growth by periods,
Any other idea?
Regards
Eduardo,
Thank you so much for your response, but this solution didn't work
Hi,
Do you have a example on qvw?
It's more easy to understand your problem if we see how you make your model.
Thanks
Hi Eduardo,
Here you have the example,
the expression "TOT" by now represents:
(Sales by month)/(Quarter Sales Average)
and we need to compare:
(Sales jan 2010) / (Sales jan 2009) and so on
In the expression your ideas are as comments if you want to review it,
thank you so much
Hi,
I use the function BEFORE to compare the dates and change your dimension to order correct '01/2009' '01/2010' and not by string.
See the example i create a table with the new expression.
Eduardo,
Could you help me using only the sales information in the previos month and not using "quarter sales information"
regards
Hi,
I read your script and the values of Quarter Sales Information are returned direct on your SQL Base.
You need to get this information from your BD.