Question

Combining Columns in Data Source View

  • 21 September 2021
  • 1 reply
  • 57 views

Userlevel 2
Badge +7

Good Afternoon,

 I was wondering if their was a way to combine the two CASE When SQL’s i have below into one view so my lobby element would show 3 columns (Records Counted, To Be Counted, New Record)

 

The new Record column i am trying to add is parts Recieved this year, Thank you for any and all help it is greatly appreciated

 

(CASE WHEN LAST_COUNT_DATE >trunc(to_date( '#START_OF_THIS_YEAR#', 'YYYY-MM-DD-HH24:MI:SS' ))   THEN 'Records Counted' ELSE 'Records To Be Counted' END)

 

(CASE WHEN RECEIPT_DATE > trunc(to_date( '#START_OF_THIS_YEAR#', 'YYYY-MM-DD-HH24:MI:SS' )) THEN 'New Record' ELSE 'Needs To Be Counted' END)

 


1 reply

Userlevel 5
Badge +6

Hi @Rpauley ,

Please check whether you can use conditions as follows.

CASE

WHEN LAST_COUNT_DATE >trunc(to_date( '#START_OF_THIS_YEAR#', 'YYYY-MM-DD-HH24:MI:SS' ))

THEN 'Records Counted' 

WHEN LAST_COUNT_DATE <trunc(to_date( '#START_OF_THIS_YEAR#', 'YYYY-MM-DD-HH24:MI:SS' ))

THEN 'Records To Be Counted'

WHEN RECEIPT_DATE > trunc(to_date( '#START_OF_THIS_YEAR#', 'YYYY-MM-DD-HH24:MI:SS' ))

THEN 'New Record' 

WHEN RECEIPT_DATE < trunc(to_date( '#START_OF_THIS_YEAR#', 'YYYY-MM-DD-HH24:MI:SS' ))

THEN 'Needs To Be Counted'

Reply