Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

select one value only

I want to ask how I can select only one value in qlikview?

I have for example one employer but registered in two company in the same month .

I already have some condition in set analysis

Count({$<_TransType={'CONTRACT'},_YearMonth={'$(vCurrentMonth)'},Month=,Year=,[Month AR]=>} DISTINCT %COMPANY_NUMBER)

9 Replies
Anil_Babu_Samineni

Does this selection one value from Listbox then you may look this. or can you describe more

Capture.PNG

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
vinieme12
Champion III
Champion III

please post some sample data/ app to explain clearly the problem and expected output.

QlikCommunity Tip: How to get answers to your post?

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

dear,

while loading the data in qvd, there are two row for same employer in same month and same year,

I want to select only one value ,according to the expression which I posted earlier with distinct it's not worked because I have two different companies.

vinieme12
Champion III
Champion III

So is it like below

Employer,year,month,Company

A,2016,1,ABC

A,2016,1,XYZ

On what basis would you want to drop a row?

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

Untitled.png

I have this key, it's concatenated of Employer no, Company no, branch no and last value is registration start date , I want to select the max number or registration start date for each Employer

and with certain condition like this :

Count({$<_TransType={'CONTRACT'},_YearMonth={'$(vCurrentMonth)'},Month=,Year=,[Month AR]=>} DISTINCT %COMPANY_NUMBER)

by this expression I get two ,but I want only one value (according the max value of registration start date)

engishfaque
Specialist III
Specialist III

Dear Maeda,

Distinct Keyword used to return only distinct values and it checks/compare all the columns (fields) data if you are loading more than one field. Means it check/compare whole row data with another data if there is any one change it will return you the value.

For clear understanding, example is given below

Example 1 with Distinct Keyword Output

----

 

Input
Emp NameCompany
IshfaqueABC
IshfaqueXYZ

 

Output with Distinct Keyword
Emp NameCompany
IshfaqueABC
IshfaqueXYZ

----

Example 2 with Distinct Keyword Output

----

 

Input
Emp NameCompany
IshfaqueABC
IshfaqueABC

 

Output with Distinct Keyword
Emp NameCompany
IshfaqueABC

Kind regards,

Ishfaque Ahmed

Not applicable
Author

I understand distinct but in my expression I need to add some thing like max or aggr but how I write them in my example?!

vinieme12
Champion III
Champion III

then try

Load Distinct Key,

MAX(Registration_Date)  as RegistrationDate

FROM  YOURSOURCE

GROUP BY Key,remainingfield1,remainingfield2.....and so on

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

I will apply this but in this way, I have to write group by

let me try and then I will post the result of this solution

regards;