Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

New to Qlikview - writing expressions

Hi, I'm new to Qlikview and trying to get to grips with writing expressions. I am using basic sales data and have created an expression to review sales either by month or year to date (depending whether I select the month or a group of months). However I want to be able to view a single months sales and cumulative/year to date sales in the same pivot table. I also want to be able to do this without having to change the expression each time I want to change the latest month. Any ideas would be much appreciated.

1 Reply
Not applicable
Author

What I did one time to have an accumulative sum of sales base on the month of the selection was used the set analysis and some Variables:

I have a date island that include month, quarter, year etc and with that I make some variables like:

M= month 

Y=Year

and I put a Selector for the month and the year in the report so the user can choose what to analyse, then in the report I used the next formula

=sum({$<M=,[Date]={"<=$(vMaxDay)>=$(vMinDay)"}>}[Sales])

where vMaxDay = max(Date) and vMinDay = =makedate(Y,1,1)

What i got was the accumulated sum of sales, if the user choose april the expression returns the sum of jan, feb, mar and apr... so Hope it helps.

Regards!