#1 2016-07-01 19:29:52

Zergio
Member
Registered: 2016-07-01

Computed Columns in Dynamic List

Hi,

In  a Dynamic List including a few columns of  the Table of Invoices (PCV table), I would like to create a computed column "Sales_2014" from 2 existing columns in the list : "PCVMT" (Invoices amounts) and "PCVDATE" concerning Invoice Dates  filtered on  a period of 2 years (from 2014-01-01 to 2015-12-31) in the same list..

Is it possible to create a new column "Sales_2014" in my Dynamic List with only the amounts of the year 2014 and with  blanks ou "0" corresponding to the year 2015 in the List (because the list contains all the dates).

My target is to create another column "SALES_2015" in view to compare the amounts of the 2 years in link with Clients Country ,other column in the same list..

Thank you for your help.

Offline

#2 2016-07-02 09:25:34

Thomas Davies
datenwerke
Registered: 2016-05-18

Re: Computed Columns in Dynamic List

Hi Zergio,

welcome to the ReportServer forum.

I am not sure I fully understand, how the new columns should look like. Could you post an example of the data you have in the table and the result that you would like to get.

Probably you can get the desired result using a case statement (see e.g., https://www.1keydata.com/sql/sql-case.html for an introduction) within a computed column:

CASE WHEN test2014Expression THEN 2014Column
ELSE 0
END

Best Regards,
Thomas

Offline

#3 2016-07-02 15:26:18

Zergio
Member
Registered: 2016-07-01

Re: Computed Columns in Dynamic List

Hi Thomas,

Great!! Your formula is OK!
This is the formula with a little correction:
CASE WHEN PCVDATE LIKE '2014%' THEN PCVMT
ELSE '0'
END
Thank you very much.

Best Regards

Serge

Offline

Board footer

Powered by FluxBB