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

Comparing selected data with previous data

Hi Guys,

I have a table with Revenue numbers with dates and months. I want to compare the selected Revenue numbers with the previous Revenue numbers. (SELECTED_REV / PREVIOUS_REV)

For eg. if i have selected Mar then I would like to Compare Revenue in March compared to Revenue in Feburary (MAR_REV / FEB_REV). If the user sellects March and April then it should be compared with Jan and Feb.

I dont want to hard code it for any fixed duration. Any ideas?

6 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     Try below function to get the previous month data.

     Consider you have Month,Year and Date as field name.

     Sum{<Month = {"$(=month(addmonths(Max(Date),-1)))"},Year=,Date=>}Sales)

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 Kaushik,

This works for  a single selection but when I choose multiple months then it doesnt give the correct answer. The QVW file is attached.

Regards

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

HI,

     Its right. This expression will be for one month selection only.

     what you exactly want to do, will you please describe with example.

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

I want to find the percentage increase in Sales. So if the user selects Feb then it should display the percantage growth of sales over Jan (this can be done with the expression you provided).

However the user will also be selecting multiple months. Lets say Apr, May and June. In this case i want to see Sales of Jan, Feb and Mar so i can find out the percentage growth of sales.

Gysbert_Wassenaar

You can try using the above function. This has one disadvantage: the first selected month can't be compared with the previous one. If you need that you'll have to create an 'AsOf' table. See attached qvw for both options.


talk is cheap, supply exceeds demand
Not applicable
Author

Thanks. You guys have somewhat answered the question but it still doesnt work with multiple selections. But ill try to make this work