Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

String function in count()

Hi,


i have different Domains and get the urls by this: Subfield(url, '/', 1)


So i get from this url the red part:

www.domain.de/procucts/...

www.domain.com/procucts/...


Now i want to count all sales from www.domain.de and try this (and a lot of other syntaxes):


count( {<Subfield(url, '/', 1) = {"www.domain.de"}>} Sales)


But it doesn´t work.


What is the correct syntax for it?


regards,

Sam

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Also in the load script you could create a new field called Domain using your Subfield(url, '/', 1)

Then you could use this as a dimension in a Straight table and an expression of count(Domain) and thus get a table with a count for each Domain.

View solution in original post

6 Replies
sunny_talwar

Try this:

Count( {<url = {'www.domain.de*'}>} Sales)

Anonymous
Not applicable
Author

Also in the load script you could create a new field called Domain using your Subfield(url, '/', 1)

Then you could use this as a dimension in a Straight table and an expression of count(Domain) and thus get a table with a count for each Domain.

Anonymous
Not applicable
Author

If i want to combine a field and wildcard like

Count( {<url = p(Domain*)>} Sales)

What is the correct syntax for it?

regards,

Sam

sunny_talwar

May be something like this:

Count({<url = {$(=Chr(39) & Concat(DISTINCT Domain & '*', Chr(39) & ', ' & Chr(39)) & Chr(39))}>} Sales)

Anonymous
Not applicable
Author

Thanks, i use the load script solution it´s more clearly in this case.

regards,

Sam

sunny_talwar

Sure thing. I agree that loading it in the script is much more easier, but I thought you were reluctant to make changes in the script . I would make my life easier, just like Bill mentioned, by making most of my changes in the script.

Best,

Sunny