Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Now Live: Qlik Sense SaaS Simplified Authoring – Analytics Creation for Everyone: READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
karlykrebs
Contributor III
Contributor III

How to Change a Data Value

Hi I'm trying to change a data value from one text to another. I've tried below but it doesn't seem to work:

SELECT

If(Field = 'A', 'B', Field) as Field

From dbo.table

Any ideas how I can change the text? thanks!

1 Solution

Accepted Solutions
rafaele2b
Contributor
Contributor

hi Karly,

The problem is that you are trying to transform where the sql statement is made and at that point it does not accept qlik transformations.

as Youssef is explaining, this transformation must be done in the LOAD instruction so you should have something close to this:

any_table_name_you_like:

load

     If(Field = 'A', 'B', Field) as Field;

sql select Field from dbo.table;

or

any_table_name_you_like:

load

     If(Field = 'A', 'B', Field) as Field,

     Field2,

     Field3;

sql select * from dbo.table;

i hope it works for you !!!

best regards

Rafael

View solution in original post

4 Replies
YoussefBelloum
Champion
Champion

Hi,

you're trying to load using your DB engine or Qlik engine ?

1. loading using your DB engine, you should use your ENGINE SYNTAX, for SQL DB for example, you should use SQL SELECT and continue the transformation using it's specific syntax.

2. with Qlik engine, you should use LOAD statement

So if you're using Qlik engine, just replace SELECT with LOAD

el_aprendiz111
Specialist
Specialist

Hi,

table:
LOAD *, If(Field = 'A', 'B', Field) as Field;
SQL SELECT * FROM 

jerifortune
Creator III
Creator III

Try using case statement

SELECT

   Case WHEN Field = 'A' THEN 'B' ELSE Field END as Field

FROM dbo.table

rafaele2b
Contributor
Contributor

hi Karly,

The problem is that you are trying to transform where the sql statement is made and at that point it does not accept qlik transformations.

as Youssef is explaining, this transformation must be done in the LOAD instruction so you should have something close to this:

any_table_name_you_like:

load

     If(Field = 'A', 'B', Field) as Field;

sql select Field from dbo.table;

or

any_table_name_you_like:

load

     If(Field = 'A', 'B', Field) as Field,

     Field2,

     Field3;

sql select * from dbo.table;

i hope it works for you !!!

best regards

Rafael