Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
kristof_j
Creator III
Creator III

variable with comma parameter

Hi all

I wanted to use a variable with parameter and use 'total' as parameter. Like this expression

$(eCountDistinct( total ))

So far so good.

When I want to expand the total with 2 parameter like 'total <product_level1, product_level2>' the comma is interpreted as the end of the variable parameter.

The following examples don't work:

  • $(eCountDistinct( total <product_level1, product_level2> ))
  • $(eCountDistinct( 'total <product_level1, product_level2>' ))
  • $(eCountDistinct( "total <product_level1, product_level2>" ))

How can I solve this?

1 Solution

Accepted Solutions
marcus_sommer

In general that's possible - you could replace everything with the parameters but you must be careful how to declare the various parameters and how they are then processed within the variables. If you want to replace nearly everything with multiplen dimensions within totals and set analysis and something more then you will need some efforts to build a stable logic and to find the right syntax for each type.

I think this will be helpful for you: (and read the comments, too)

Variables

Re: nested variable troubles

Comma problem (,) workaround for dollar sign expansion with parameters

- Marcus

View solution in original post

22 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Did you try enclosing the parameter with quotes?

$(eCountDistinct(' total <product_level1, product_level2> '))

or

$(eCountDistinct(" total <product_level1, product_level2> "))

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
kristof_j
Creator III
Creator III
Author

I tried that but I didn't work.

Does it work with you?

sunny_talwar

See if this helps:

eCountDistinct

count(DISTINCT $1, $2  customer)

eExpression

$(eCountDistinct($(vParameter)))

vParameter

1) TOTAL <product_level1,>

2) TOTAL <product_level1, product_level2>

Anil_Babu_Samineni

eCountDistinct -- count(DISTINCT $1 customer) -- Here , what you want to achieve

vParameter -- total <product_level1> -- Is that is Garbage error(What is the mean of set expression)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
jonathandienst
Partner - Champion III
Partner - Champion III

No, I have never had this problem, so it was just my 2c worth

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
antoniotiman
Master III
Master III

Why not

kristof_j
Creator III
Creator III
Author

This is a step forward.

But I still experience some difficulties when I want 3 or more parameters in the total.

I wanted to use this method for some expressions that have 5 dynamic parameters in the total.

vinieme12
Champion III
Champion III

see attached

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
kristof_j
Creator III
Creator III
Author

I wanted to use a variable with a parameter so that I can use this for several expressions with different totals.

In this way I have 1 expression to maintain and other expressions that use that one expression with different totals.

I used vParameter just to make it more easy to make changes if you guys wanted 🙂

Your sollution would be plan B.

I thought I could make it more elegant 🙂