If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Macro Functions: Convert CSVIdentityNameList() to array

Started by MrKlar, 01 Oct 2024 08:31:43 AM

Previous topic - Next topic

MrKlar

Hi there,

CSVIdentityNameList() gives me back comma separated values. How do you convert that into a macro to be able to make use of grep() function to be able to search for a certain value?

Thank you very much.

MFGF

Quote from: MrKlar on 01 Oct 2024 08:31:43 AMHi there,

CSVIdentityNameList() gives me back comma separated values. How do you convert that into a macro to be able to make use of grep() function to be able to search for a certain value?

Thank you very much.

Hi,

CSVIdentityNameList() is a macro function - you can only use it in a macro. Anything within hashes is classed as a macro, so #CSVIdentityNameList()# is a very short macro that returns your comma delimited list of account name, groups and roles. You can use any other macro syntax within the hashes, also, so you could add in your grep command

#
join('',
grep('System Admin',CSVIdentityNameList())
)
#

Not sure what you're trying to achieve? CSVIdentityNameList() returns an array of strings, which may or may not be what you need?

Cheers!

MF.
Meep!

MrKlar

Quote from: MFGF on 01 Oct 2024 09:26:23 AMjoin('',
grep('System Admin',CSVIdentityNameList())
)
#

MF.

Hi MF, thank your for the quick reply.

However, if I use your above macro code, I get the following error:
Argument type 2 of function 'grep' is: string, but the required type is: array.

That is why I was posting the question, wondering what data type CSVIdentityNameList() actually returns.

However with a split function inbetween and douple pipes (||) the conversion to an array seems to work, at least for me:

# join(','; grep('System Admin'; split('||';CSVIdentityNameList('||')) ) ) #