Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using special characters in Calculated Dimension in QLikView

I have a Calculated Dimension in a Pivot Table with some characters which may be interpreted as special characters. I suspect that this is the cause for the 'error in calculated dimension' which i get.

Characters include '/', '.', '&', '(', ')'. Which characters are indeed special characters, and how to make them been considered as normal characters ?

Thanks in advance

13 Replies
shane_spencer
Specialist
Specialist

Paste the below in a QVW and look at the two tables.

Test:

LOAD * INLINE [

    F1

    "1'2'3'4'5"

];

Load

    SubField(F1, Chr(39), 1) as 1,

    SubField(F1, Chr(39), 2) as 2,

    SubField(F1, Chr(39), 3) as 3,

    SubField(F1, Chr(39), 4) as 4,

    SubField(F1, Chr(39), 5) as 5

resident Test;

its_anandrjs
Champion III
Champion III

Another way is you can use Purgechar, keepchar or sub field functions to achieve this.

Ex:-

LOAD Concat(NewText1,'') as NewText2;

LOAD Text,KeepChar(Text,'abcdefghijklmnopqrstuvwxyz') as NewText,

SubField(SubField(SubField(SubField(SubField(Text,'/'),'.'),'&'),'('),')') as NewText1;

LOAD * Inline

[

Text

asdfjsda/dsda.dasdas&sdasd(sdas)

];

Not applicable
Author

Thanks for that all.

However, I am looking at a way to have special characters in a calculated dimension... and there if I replace single quote with chr(39), it writes the string Chr(39)...

shane_spencer
Specialist
Specialist

Can you share your application with a little bit of sample data in it? That might help.