Announcements
cancel
Showing results for
Did you mean:
Creator III

## How to calculate previous Date 's sum(Sales)?

Hi,

I am using the below table:

[Data]:
DateData, Sales
12/11/2017, 2012
12/10/2017, 2015
12/09/2017, 2016
12/08/2017, 2017
12/07/2017, 2018
]
;

and use a straight table:

and use DateData as dimension and Sum({\$<[Process Date] = {"\$(date(only([Process Date]-1)))"}>}[Sales Posting Amount USD]) as expression. But I get '0' for all fields.

Thanks,

Sandip

1 Solution

Accepted Solutions
MVP

Check if this looks good

13 Replies
MVP

May be try

Above(Sum({<DateData>}Sales)) * Avg(1)

or use The As-Of Table

MVP

Here is a sample attached

Partner - Master

Hi,

May be expression  Above(Sum (Sales))?

MVP

AsOfTable example attached

Creator III
Author

Hi,

I just attached my sample qvw file. Please can you edit the 'Demo' straight table chart. Currently it does not show any data for

'Prior Date Sale' column's value under it.

Thanks,

Sandip

MVP

Since you used two dimension, you needed to add Total after Above

Above(TOTAL Sum({<[Process Date]>}[Sales Posting Amount USD])) * Avg(1)

Creator III
Author

Hi,

it looks ok. But I need to implement the logic as : if the previous day's value is null or not exists in data model, then it will be null, but you can see that for Prior Date: 12/07/2016 , it is not present in the data model, but the prior date sale value is coming for 12/08/2017. SO it should be null or blank value. So instead of showing -100 it should show only 0 in the table.

So the logic should be if a date's prior date is not present in the data, it will show null or 0 prior date sale's column value.

Thanks,

Sandip

MVP

Then it would be best to use The As-Of Table approach here

Creator III
Author

Hi,

I have seen it. But I did not understand how to implement it in my case.

So I am requesting you if you can implement it in my sample QVW document.

Thanks,

Sandip

Community Browser