Qlik Community

QlikView Deployment

Discussion Board for collaboration related to QlikView Deployment.

Not applicable

Current selections delimiter

Hi,

I want to specify the delimiter for the values selected. In the attached image,

KBS AMERICA, INC  and

MULTIPOLE INTERNATIONAL LTDA  are two different partner names. But,

since a comma appears in the name , and the default delimiter is a comma,

we cannot split it around comma. What other option do I have to get the partner names?

This is the C# code we use via API...

  IReturn5 selections = axQlikOCX1.ActiveDocument.GetCurrentSelections();

  IList selectionValues = (IList)selections.Selections; --> this returns the values delimited by comma

IList selectedFields = (IList)selections.VarId;

Thanks,

Anju

1 Solution

Accepted Solutions
Not applicable

Re: Current selections delimiter

Hi All,

I was able to find a solution.

Steps:

1) Define a variable say , 'vSelections' under Settings -> Variable Overview

        with definition =GetCurrentSelections('#`','@`','`~') [pls see function description in reference doc]

2) I am using C# via QMSAPI.

    Some code tidbits :

               string selection_content = axQlikOCX1.ActiveDocument.Variables("vSelections").GetContent().String; --> fetch variable contents

               string[] tag=Regex.Split(selection_content, rec_sep); -->split around various separators..

   

              where I have defined some variables as follows:


              private string rec_sep = "#`", tag_sep = "@`", value_sep = "`~";

             and so on...

Additionally, I can give a 4th parameter for the function ...GetCurrentSelections('#`','@`','`~',10)..So, here, 10 is the maximum number of individually listed selections..i.e, if I select 11...it will be displayed as 11 of 45 ..etc...

Regards,

Anju

7 Replies
sujeetsingh
Honored Contributor III

Re: Current selections delimiter

It means you want to split the names with comma as deliminiter .

It seems tough to do

Not applicable

Re: Current selections delimiter

Yes, it is...been looking for a solution for quite a few days.

in the desktop environment, we can use GetCurrentSelections this way

GetCurrentSelections(':','=','::') whereby we can specify the default delimiter.

But , QMSAPI does not support the overloaded version!

Not applicable

Re: Current selections delimiter

Hi Son of Sardar,

I just added the attachment now.

Regards,

Anju

Not applicable

Re: Current selections delimiter

Where is the setting for default delimiter?

sujeetsingh
Honored Contributor III

Re: Current selections delimiter

Anju tell one thing that what you really want as output.

Not applicable

Re: Current selections delimiter

Using API, I want

KBS AMERICA, INC <separator>

MULTIPOLE INTERNATIONAL LTDA  instead of

KBS AMERICA, INC,MULTIPOLE INTERNATIONAL LTDA

where I can set the <separator>

Not applicable

Re: Current selections delimiter

Hi All,

I was able to find a solution.

Steps:

1) Define a variable say , 'vSelections' under Settings -> Variable Overview

        with definition =GetCurrentSelections('#`','@`','`~') [pls see function description in reference doc]

2) I am using C# via QMSAPI.

    Some code tidbits :

               string selection_content = axQlikOCX1.ActiveDocument.Variables("vSelections").GetContent().String; --> fetch variable contents

               string[] tag=Regex.Split(selection_content, rec_sep); -->split around various separators..

   

              where I have defined some variables as follows:


              private string rec_sep = "#`", tag_sep = "@`", value_sep = "`~";

             and so on...

Additionally, I can give a 4th parameter for the function ...GetCurrentSelections('#`','@`','`~',10)..So, here, 10 is the maximum number of individually listed selections..i.e, if I select 11...it will be displayed as 11 of 45 ..etc...

Regards,

Anju

Community Browser