Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Previous function in expression


Hi

I am trying to come up with a report that is showing change-% by material type compared to previous period with the expression in pivot.

The result at the moment can be seen in attachment. I am using there rangesum above function. In the attached picture it works like it should, but once I change the period into horizontal axis it doesn't work anymore. My script is in that case returning the result from the row above which is for different material type. How should I modife the script that it would look for previous result from left instead of above (from the previous period)? Or what would be the better solution to return the result for the same material from the previous period assume in that way this might work.

I am using at the moment following script in my previous column

rangesum(above(sum(MonthEndValue),1,1))

Thanks in advance

Regards

Janne

3 Replies
Not applicable
Author

Hi,

For the columns, use BEFORE() function

If you need to make lots of calculation vs Y-1, previous period, perhaps you will need to modify your data model.

See a doc I have written a few weeks ago: http://community.qlik.com/docs/DOC-4821

Fabrice

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

    Have a look at the application.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Thanks for this hints but I think they are not something I can apply here. I could do this in script like Aunez proposed, but this would be only expression in where I would need that. That is why I would like to do this in expression.

It would be "inventory period" the dimension that I would like use here (previous in that dimension)

Thanks

Regards

Janne