Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Guys,
I am confused why it does not work, but when I load the following table from the SQL Databank into Qlikview the category field does not give any fields. I wonder what can be the reason.
SQL Databank view:
Qlikview view:
I tried text(Category) as Category but it does not work. Any Ideas?
Thanks in advance
sravan
Hello Sandro,
As I previously said, Text does not work..
Hello,
then choose the second SQL-Statement in my post above. This is the syntax for SQL-Server. I recognized in the error message that you extract from a SQL-Server database. But code it without blanks at the numbersign. Because the '#' should serve as a bracket to see what does really come from the SQL-Server.
RR
Hi Roland,
Thanks for your answer. I could come one step forward. The second SQL Statement can be run
Products:
LOAD Id,
Sequence,
Name,
Description,
Category,
GoodProductYN;
SQL SELECT
Id,
Sequence,
Name,
Description,
'# ' + Category + '# ' as Category,
GoodProductYN
FROM OEE1.dbo."View_Products";
Now what does it mean?
Thankyou for your Patience.
Hi sravan,
this points to that you got some garbage data in your database-field. Let's try it with this
'<' + Category + '>' as Category,
please with no (!) blanks. Then we should be able to see if the garbage is in front or behind your field-value.
I am looking forward to the result (it looks like there is a special char in the field)
RR
Hi sravan,
yes, behind or in the field itself, perhaps a simple CR (carrige return). Don't know (your data).
Now play "Emil und die Detektive". How long is your field? Do you have a simple SQL-workbench? How does output is shown there ? Can you export (some rows of) your table into a text-file? Use the brackets at the beginnung and end of the field. Check the output. Ask your data-manager for some possible reasons.
RR
Hi Roland,
Only 1 char long and that is G or S or R etc..I just got a backup file(.bak) from the company with testdata and I restored it by installing Microsoft SQL Server Management Studio Express. I tried to send it as a textfile but did not find any option to do it.
Thanks for your help and patience. I dont know anyway how to solve this problem.
Sravan
Hi sravan!
Have you tried?
LOAD Id,
Sequence,
Name,
Description,
if(text(Category)='G','Good',
if(text(Category)='S','Scrap',
if(text(Category)='R','Rework','Null'))) as Category,
GoodProductYN;
SQL SELECT Id,
Sequence,
Name,
Description,
GoodProductYN,
Category
FROM OEE1.dbo."View_Products";
Hi Sandro,
It gives only Null() in the answer as I expected.
Thanks anyway. May be someone has an idea how to tackle it in the qlikview side. I am parallely asking the data manager for some possible reasons but they insist it is correct in SQL Side.
Sravan
What does sql server return for below query
SELECT
Category,
ascii(Category)
FROM OEE1.dbo."View_Products"
SQL SELECT
Id,
Sequence,
Name,
Description,
GoodProductYN,
char(ascii(Category)) as Category // convert to number, then back to character
FROM OEE1.dbo."View_Products";