logo

Warning: The forum is now for consultation only. Please use GitHub Discussions to post any questions or comments.


Welcome Guest ! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
siobhan  
#1 Posted : Thursday, June 5, 2014 12:09:02 PM(UTC)
siobhan

Rank: Member

Groups: Registered
Joined: 6/5/2014(UTC)
Posts: 23
Ireland
Location: Dublin

Thanks: 1 times
Hi

Can I create a field within my report and change the value of that field depending on the output of the field.

I want to create a text field, 'Status' So as each record is being read I can change the value of this field,

Say if table.liberty_no = null then status = 'Signed Up'
Else Status = 'Installed'

Regards
Siobhan

Edited by moderator Friday, June 6, 2014 7:51:52 AM(UTC)  | Reason: Not specified

epf  
#2 Posted : Thursday, June 5, 2014 4:48:05 PM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 1,209
Switzerland

Thanks: 14 times
Was thanked: 206 time(s) in 199 post(s)
Actually you should use your database engine to do that...

In SQL Server or Oracle it would be a new column named Status in your base table with the SQL:
Code:
case when table.liberty_no = null then 'Signed Up' Else 'Installed' end


If you don't want to modify your data source, you can add an element in your model, then use Custom SQL to set the Case statement...


Another way to translate database values into display values is to create an enumerated list from your liberty_no column.

Hope it helps.

Edited by user Friday, June 6, 2014 7:58:46 AM(UTC)  | Reason: Not specified

siobhan  
#3 Posted : Friday, June 6, 2014 8:26:26 AM(UTC)
siobhan

Rank: Member

Groups: Registered
Joined: 6/5/2014(UTC)
Posts: 23
Ireland
Location: Dublin

Thanks: 1 times
Thank you for that response,

I will be using the Case When on different fields however as you predicted, I do not want to change the value of that data element so therefore I do need to add an element,

I am very new to SEAL reporting so please bare with me ....

I have no idea how to create this Element, do I have to an additional Table to hold the temporary data. If I right click on any of the Element boxes it doesn't give me any options to create an Element.

Thanks and Regards
Siobhan
siobhan  
#4 Posted : Friday, June 6, 2014 8:34:00 AM(UTC)
siobhan

Rank: Member

Groups: Registered
Joined: 6/5/2014(UTC)
Posts: 23
Ireland
Location: Dublin

Thanks: 1 times
I would have displayed the status as follows in previous reporting tools


SELECT CASE WHEN UPPER(parent_source) != "" THEN UPPER(parent_source) ELSE "NO PARENT SOURCE" end as 'Parent Source',
customer_id,
"Installed" as 'Status'

FROM

WHERE `status` = 'Active'
and liberty_meter_number != ''

and the status field would just come as part of the SELECT Statement, Maybe I need to create a whole select STATEMENT using the individual SELECT Clause, FROM Cause etc and not the drag and drop?

Regards,
Siobhan

Users browsing this topic
Guest (2)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.