Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
My_Rebecca
Creator
Creator

Count & Distinct in Data Manager

I want to calculate the following data in Data manager, but fail to get the answer, How to improve this expression?

 

My_Rebecca_1-1672711295245.png

 

 

Labels (1)
6 Replies
sidhiq91
Specialist II
Specialist II

@My_Rebecca  Could you please post the current expression that you are currently using?

vinieme12
Champion III
Champion III

Set analysis is for evaluation in front end charts only,

I would suggest you create a calculated dimension as below

fieldname = if(SpecialStockNumber<>'E',SalesDocument&SalesDocumentItem ,null())

then in charts use measure

=Count(distinct fieldname )

 

 

 

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

@sidhiq91  Please refer to this express, thanks.

Count({<[DC TJ Inventory.Special Stock]<>'E'>}[DC TJ Inventory.Material])+count(distinct([DC TJ Inventory.Sales document]&[DC TJ Inventory.Sales Document Item]))

My_Rebecca
Creator
Creator
Author

@vinieme12 It works at sheet edit, not Data Manager, because it seems that "Distinct" does not work at Data Manager.

vinieme12
Champion III
Champion III

if you want to use aggregation functions during data loading you need to use group by as well

Choose the "Data Load Editor "  instead of "Data Manager"

example

Temp:

Load   field1,field2,MeasureField1

From SomeDataSource;

Main:

Load field1,count(Distinct MEasureField1) as  newField

Resident Temp

Where field1<>'Something'

Group by field1;

 

Or the same thing can just be calculated in chart as below

Temp:

Load   field1,field2,MeasureField1

From SomeDataSource;

 

In chart

Dimension = field1

Measure = count({<field1-={'Something'}>}distinct MeasureField1)

 

 

 

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

@vinieme12  thanks for your support, I get your point.