Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Distinct in set analysis

Hi guys,

I am trying to convert the following sql

SELECT  Distinct ID FROM invoiceLine" where number is null

to a set analysis expression.

Can you please help me with it?

Saurabh

1 Solution

Accepted Solutions
maxgro
MVP
MVP

count(distinct    RobSuggestion     ID)

example: =count(distinct {$<id = P({1<bonus={"*"}>})>} sales)

View solution in original post

8 Replies
alexandros17
Partner - Champion III
Partner - Champion III

You are melting Script and layout environments, when data is loaded it can be diplayed in a wide variety of ways

depending on your dimension and expression.

Set Analysis is related to the way data is displayed and data must be "aggregated" in some way!

Hope it helps

Not applicable
Author

how about this

select ID, count(*) from invoiceline where where number is null group by ID...

here we have aggregate function...

Jason_Michaelides
Luminary Alumni
Luminary Alumni

For use in the script?

Not applicable
Author

no in expression....

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You can do it either with a search expression or the indirect E() operator. Here it is with E().

{$<ID = E({1<number={"*"}>})>}

-Rob

Joseph_Musekura
Support
Support

Hi

Set Analysis

Sets can be used in aggregation functions. Aggregation functions normally aggregate over the set of possible records defined by the current selection. But an alternative set of records can be defined by a set expression. Hence, a set is conceptually similar to a selection.

As mentioned in the first response, you need to check what you want to achieve and make a difference with SELECT in SQL and the use of SET ANALYSIS

Regards,

Not applicable
Author

This is what I am trying

Count(DISTINCT {$<ID= E(1<number={"*"}>)>})

But it gives me error "Error in set modifier element function" at curly brace after "number="

Is there any thing here?

maxgro
MVP
MVP

count(distinct    RobSuggestion     ID)

example: =count(distinct {$<id = P({1<bonus={"*"}>})>} sales)