Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Announcements
Qlik Analytics Tour 2020 Online. Begins August 10th. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator II
Creator II

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?

Tags (2)
1 Solution

Accepted Solutions
Highlighted
MVP & Luminary
MVP & Luminary

Re: variable with comma parameter

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
Highlighted
MVP
MVP

Re: variable with comma parameter

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
Highlighted
Creator II
Creator II

Re: variable with comma parameter

I tried that but I didn't work.

Does it work with you?

Highlighted

Re: variable with comma parameter

See if this helps:

eCountDistinct

count(DISTINCT $1, $2  customer)

eExpression

$(eCountDistinct($(vParameter)))

vParameter

1) TOTAL <product_level1,>

2) TOTAL <product_level1, product_level2>

Highlighted

Re: variable with comma parameter

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)

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Highlighted
MVP
MVP

Re: variable with comma parameter

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
Highlighted
Master III
Master III

Re: variable with comma parameter

Why not

Highlighted
Creator II
Creator II

Re: variable with comma parameter

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.

Highlighted
Champion II
Champion II

Re: variable with comma parameter

see attached

Highlighted
Creator II
Creator II

Re: variable with comma parameter

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 🙂