Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a column in my table which contains only ones and zeros. I need a new column (or the other column replaced) that a certain string is written.
For example, I have following data:
Error
0
1
1
0
And I need in QlikSense:
Part state
Part is ok
Part is not ok
Part is not ok
Part is ok
Is there something I can do during loading the data?
Hi ,
you can try this in load script.
pick(match(Error,0,1),'Part is ok','Part is not ok') as [Part state]
Thanks
Mahaveer
hi ,
use something like this in load script ,
if([Error code]=0 or [Error code]=1 ,'no','yes') as [Error Code Accepted]
Hi ,
you can try this in load script.
pick(match(Error,0,1),'Part is ok','Part is not ok') as [Part state]
Thanks
Mahaveer
Try the following (I hope I understood you correctly:
Example table:
Tablename: ERROR:
TableColumn: Error:
1
0
1
0
0
ErrorStateTable:
Load
ERROR.Error as "ErrorID"
From ERROR;
Left Join
Load * Inline [
'ErrorID', 'ErrorDescription'
0, 'Part is ok'
1, 'Part is not ok'
]
Wow, works great. Thanks for sharing. Just another question: Can I extend the conditional part of the match statement?
I have a column which can have other values as well. E. g.
Error code
0
1
2
3
I want to accept all error codes except 0 and 1 (note that this is a simple example, actually I have a string and not a number). This should result in:
Error Code Accepted
no
no
yes
yes
so something like this:
pick(match(Error,0|1),'no','yes') as [Error Code Acceted]
hi ,
use something like this in load script ,
if([Error code]=0 or [Error code]=1 ,'no','yes') as [Error Code Accepted]