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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using % in a alias for a field

Hi there,

I am now using Qlikview 10 SR1. Previously I was using ver 9 and this problem didn't exist.

I have a load statement that says the following:



Load

FieldCode as %[Key code1] ;

SQL Select * from Table;

For some reason in QV10, I can not prefix my alias with a "%" symbol. Something like %[Key code1] will error out. What new method is there to do this functionality in QV10.What I want to do is use the syntax

Set

Hideprefix=%;



in the main tab to hide keys in my document.



5 Replies
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

I'm surprised it ever worked for you... this syntax should have never worked...

For the hiding purposes, just include the % inside the brackets, and I think it should work just fine. The brackets are not part of the field name.

Not applicable
Author

I just realized something. In qlikview, you can't have spaces in your alias name if you prefix the alias with a '%' symbol.

So if i create an alias called %[Key Code], then this would fail, but if I create an alias called %[KeyCode] then it works. Very bizzare but for some reason it works. Any thoughts on this?

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Looks like a fluke to me - perhaps, when there are no spaces or special characters, brackets are simply ignored, even if they are out of place.

Notice, that Product and [Product] are two identical fields. I'm guessing that %Key and %[Key] are also considered identical...

Not applicable
Author

Hi Oleg,

I've seen this syntax used before. I know square brackets are used when spaces exist in names i.e. Product Code needs to be called [Product Code]. This just doesn't seem to work with % preceeding it.

johnw
Champion III
Champion III

As Oleg said, the % goes inside the brackets. [%Product Code], not %[Product Code]. He was just explaining why %[ProductCode] might be working. But it's not how you should write it. As he said, if it works, it's probably a fluke.