cancel
Showing results for 
Search instead for 
Did you mean: 

Tranforming 0 to False and 1 to true

HariCS23
Contributor
0 Kudos

Gurus,

I am using sql query template and getting data as 0/1 for one column from table.

I want to show 0 as FALSE and 1 as TRUE in the iGrid.

I didn't ever use the tranform tab . Do i have to write any xslt for my query??

Or

do i have to just change the query to get that simple transformation?

Any ideas??

Please help.

Thanks

Vansi

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Don't use XSL, use the xMII Business Logic Services (BLS). Simply create a calculated column that uses the "stringif()" function.

In general, avoid using XSL for transformations unless the desired output is something other than xMII XML structure.

jcgood25
Active Contributor
0 Kudos

In this case you should leverage SQL syntax instead of creating more work for yourself.

The iGrid will obviously only display what comes back in the query, so try this:

SELECT (CASE WHEN MyColumn = 1 THEN 'TRUE' ELSE 'FALSE' END) AS Status FROM MyTable

Regards,

Jeremy

HariCS23
Contributor
0 Kudos

Thanks Jermy.

I am good with the solution you gave for above.

But in complex transformations , how do we apply xsl to the query template.

It would be great if you Could you give a small example.

Once again thanks for smart answer.

--Vansi

jcgood25
Active Contributor
0 Kudos

Your best bet is to look at the help documentation for 11.5, there are several predefined xsl examples detailed there, and the wwwroot/Illuminator/Stylesheets directory has several examples for a point of reference.

The InlineTransform tab is where you would apply this xsl file to your raw query data and it would need to take the Rowsets/Rowset/Row and produce the new desired Rowsets/Rowset/Row results. This functionality pre-dates BLS, and it will probably be easier for you to use the action blocks to do your transformations.

Regards,

Jeremy