cancel
Showing results for 
Search instead for 
Did you mean: 

Distinct of 2 columns

Spd_03
Cosmonaut

Can we create a column which calculates distinct of 2 same columns but with different filter?
Consider Column_1 is having a filter Filter_1 and Column_2 is having a filter Filter_2, here both the columns are same but filters are different. Also filters are coming from Presentation Variables.

I've tried to create one but distinct function requires second parameter as Group By.

4 REPLIES 4

Wadeyy03
Ranger

Hi,

Using formula Builder and presentation variables ->

Using the distinct function on a case condition considering the presentation variables and grouping by the region 

Wadeyy03_1-1682340734310.pngWadeyy03_2-1682340800233.png

(P.S it is +1 because it considers the else condition as well ("NULL"))

 

Spd_03
Cosmonaut

Hi @Wadeyy03 ,

Thank you for the reply, I've tried to implement both the approaches but there is slight data variation between 2 approaches.
Is it due to formula builder or any other reason??

Hi Spd_03,

It might be because of my data but maybe it is considering the "NULL" as well somewhere.

RADSr
Captain
Captain

Alternate: In an insight drag the column to the measures area - twice.    Open the measure property and drag a formula to the "filter" target: 

RADSr_0-1682357334061.png

It's a nice feature.    Note: I think you'll find it's only available for aggregated measures.   If it needs to be repeatable ( e.g. "Sales for California" ) make it a formula column in the schema.  You'll wind up w/ a bunch of formula columns, but runtime performance will be better.

-- IncortaOne@PMsquare.com --