Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Issue with Set Analysis

Hi,

The set analysis expression below will not render results for me in my chart. Does anyone see an issue with my syntax? I want to limit the calculation to the current selections based on Test only containing the values of Test1 and Test2. Thanks for the help!

 

Sum ({$,<[Test] = {"Test1", "Test2"}>}[Damage])/ Sum ({$, <[Test] = {"Test1", "Test2"}>}[Total E])

1 Solution

Accepted Solutions
sunny_talwar

Do I see a comma after $?

Sum ({$,<[Test] = {"Test1", "Test2"}>}[Damage])/ Sum ({$, <[Test] = {"Test1", "Test2"}>}[Total E])


Try this:


Sum ({$<[Test] = {"Test1", "Test2"}>}[Damage])/ Sum ({$<[Test] = {"Test1", "Test2"}>}[Total E])

View solution in original post

3 Replies
sunny_talwar

Do I see a comma after $?

Sum ({$,<[Test] = {"Test1", "Test2"}>}[Damage])/ Sum ({$, <[Test] = {"Test1", "Test2"}>}[Total E])


Try this:


Sum ({$<[Test] = {"Test1", "Test2"}>}[Damage])/ Sum ({$<[Test] = {"Test1", "Test2"}>}[Total E])

oknotsen
Master III
Master III

Remove the comma's after the dollar signs.

You can even completely remove the dollar symbols, but leaving them in will not hurt.

Maybe a personal preference, but I would use single quotes not double quotes, but this is also not a show stopper. If your value's Test1 and Test2 however contain a double quote, this can also be the cause of a problem.

May you live in interesting times!
sunny_talwar

Somebody recently pointed out to me that single quotes is a bug and is going to go away in the future versions of the application. Not sure if its true for a single value or expression, but may be we can all get into a habit of using double quotes (I am also used to use single quotes, but changing that habit now)

Source: A Primer on Set Analysis

Sum( {$<Date={"…"}>} Sales)

Do not use single quotes to initiate a search here! Single quotes should denote literals, i.e. explicit field values. (Yes, today single quotes work as a search, but this is a bug that one day will be fixed…)

Best,

Sunny