Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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!
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
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
Hi,
table:
LOAD *, If(Field = 'A', 'B', Field) as Field;
SQL SELECT * FROM
Try using case statement
SELECT
Case WHEN Field = 'A' THEN 'B' ELSE Field END as Field
FROM dbo.table
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