Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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

Tags (1)
1 Solution

Accepted Solutions

Re: Set Analysis with ' sign

use "NCA - dep'n"

6 Replies

Re: Set Analysis with ' sign

use "NCA - dep'n"

Not applicable

Re: Set Analysis with ' sign

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

adrianbuzer
Contributor II

Re: Set Analysis with ' sign

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

Re: Set Analysis with ' sign

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

Re: Set Analysis with ' sign

Thanks a lot!

That did the trick.

Cheers

Calle

Employee
Employee

Re: Set Analysis with ' sign

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)

Community Browser