Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis with ' sign

Hi all,

Im trying to write a set analysis with a string value containing ' in it.

I want it to look like this :

=sum({<[BSHeading]={'NCA - dep'n'},[QuarterFiscal]={'Q1'}>} Amount)/1000000)

but the ' sign is causing the problem for quotation marks.

So I tried the below instead :

=sum({$<CFHeading={$(=     NCA - dep'n)},[QuarterFiscal]={'Q1'}>} Amount)/1000000

but it does not swon other than 0

If someone has a solution here, I would be very happy!

PS. It could be very useful to know how to handle ' in if clauses as well! DS.

Best Regards

Calle

1 Solution

Accepted Solutions
alexandros17
Partner - Champion III
Partner - Champion III

use "NCA - dep'n"

View solution in original post

6 Replies
alexandros17
Partner - Champion III
Partner - Champion III

use "NCA - dep'n"

Not applicable
Author

Use a veriable like this

let V_Name = 'NCA-dep' & chr(39) & 'n';

and then you invoque the variable in the set analisys.

regards.

Marcelo

Anonymous
Not applicable
Author

I think you'll find that this is not possible.  I had a similar issue and had to load the data in the script without the apostrophes

Not applicable
Author

try something like

=sum({<[BSHeading]={'NCA - dep''n'},[QuarterFiscal]={'Q1'}>} Amount)/1000000)


You have to add an additional single quotes near the single quote in dep'n to make it work.

Not applicable
Author

Thanks a lot!

That did the trick.

Cheers

Calle

ToniKautto
Employee
Employee

Keep in mind to always use double quotes for values in set expressions. This way QlikView will make an exact search for your specified value. I would strongly recommend that you make double quoting a habit for set expressions.

=sum({<[BSHeading]={"NCA - dep'n"},[QuarterFiscal]={"Q1"}>} Amount)/1000000)