Loading

Returning Profit for Current and Previous Year Using a Parameter

Data pubblicazione: Apr 13, 2024
Operazione
How to return the profit for current and previous year using a parameter to choose current year.
Fasi

Step 1 - Create the parameter:

  1. Right-click the Parameters pane and select Create Parameter....
  2. Name the parameter This Year.
  3. Under Data Type select Integer.
  4. Under Allowable Values select List.
  5. Enter 2010, 2011, 2012, and 2013 in the list of date values.
  6. In the Display Format drop-down menu, select Number(Custom).
  7. Enter 0 for the number of decimal places.
  8. Clear the selection for Display thousands separator.
  9. Click OK.
  10. Right-click This Year and select Show Parameter Control.

Step 2 - Create the calculated fields:

  1. Go to Analysis > Create Calculated Field....
  2. Name the calculated field This Year Profit.
  3. In Formula enter IF YEAR([Order Date]) = [This Year] THEN [Profit] END.
  4. Repeat steps 1-3 with name Last Year Profit and formula IF YEAR([Order Date]) = [This Year] - 1 THEN [Profit] END.

Step 3 - Build the view:

  1. Drag Customer Segment to the Rows shelf.
  2. Drag This Year Profit to the Column Shelf.
  3. Drag Last Year Profit to the Column Shelf.
Risorse aggiuntive
To view the above steps in action, see the video below. 
Note: the video is silent. 


 
Numero articolo Knowledge

001458237

Allegati

Example Current and Last Year.twbx

1203 KB

 
Caricamento
Salesforce Help | Article