Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi!!
i v got tu do a graphic and chart of sells by month
but i want to compare previous month to selected month always
i do this :
=sum({$<month={$(=AddMonths(month,-1))}>} sells)
but it doesnt work
obviously because for exemple then i selected sptember there s no month agust in selected records, there s only september records !
how can i do that ???
Hi king-greg.
You can do that using variables... See the file
Reggards,
Bruno
it doesnt work
i create a variable : vtest=Date(AddMonths(month, -1))
i put
=sum( {$<month= {$(vtest)}>} MCD_B )
an nothing appeared!!
Hi
Try like this
in variable, Month(AddMonths(Max(Date),-1)) gives Aug,if max(Date) equal to today
Addmonths works with by adding a number of months to a date.
Try =sum({$<month={$(=Only(month)-1))}>} sells)
it doesn wotks
i dont know how to do that
get 2 selections at a time !
King, what's your Qlikview Server Version?
11
Create a variable "VAR_PreviousMonth" whit this expression:
=Num(Month(AddMonths(YourDateFieldHere, -1)))
And, next, in your graph's expressions, try this
Sum({<YourMonthFieldHere={'$(VAR_PreviousMonth)'}>} YourValueFieldHere)
Good Luck!
Bruno Oliveira
HI
Try like this
For Current month
=Sum({<DateFieldName={"=$(=Max(DateFieldName))"}>} Sales)
For Previous month:
=Sum({<DateFieldName={"$(=Addmonths(Max(DateFieldName), -1))"}>}Sales)
If not satisfy your requirement, can you post a sample file
Hope this helps you.