Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
fallenangel6
Creator
Creator

left Keep issue

hi all,

i have two tables base table and validation table.  base table have a counter .when i do left join between base and validation, i am getting extra duplicate records and so when i take sum(counter), the count is more . i tried using left keep and count now matches the desired count but the problem is i have done some if conditions and all like below in validation table

If(IsNull(Email_validated_manually) or Email_validated_manually='',0,Email_validated_manually) as Email_Validated_Final,// 1 or 0 values to be used as flags

If(Email_validated_manually=1,'Yes','No') as Email_Validated,// for filters in front end

and this maps incorrectly when left keep is done.

Please help.Sample data given below.

i cant put up an accurate scenario here but in my data model, by using left keep my count matches. but i need to create some field based on the validation table to filter the base table. how can that be possible?

base table:

clsidpartyrkemail correct patternemail incorrect patternPan correct patternPan incorrect pattern
111111010
111120001
111131011
111140101
222251010
222260110
222271100
333380110

 

validation table:

partyrkEmail validated manuallyEmail Manual commentpan validated manuallyPan Manual comment
41correct Email  
81correct Email pattern  
41email id correct1Correct Pan

 

the desired output is

 

clsidpartyrkemail correct patternemail incorrect patternPan correct patternPan incorrect patternEmail validated manuallyEmail Manual commentpan validated manuallyPan Manual commentEmail Validatedpan validated
111111010    NoNo
111120001    NoNo
111131011    NoNo
1111401011email id correct1Correct PanYesYes
222251010    NoNo
222260110    NoNo
222271100    NoNo
3333801101correct Email pattern  YesNo
2 Replies
wandererroch
Contributor III
Contributor III

 

Unless you can get your validation table down to a single row per partyrk you are going to have trouble with this.  Can you summarize the validation table into a single (most recent) row per partyrk?  Using that should give you the result you seek.  other than that you'll need to get fancy parsing the table with if statements (not fun).

fallenangel6
Creator
Creator
Author

I tried using updated date(which is another column in validation table) to
fetch the most recent column but the problem I face now is that same
partyrk is updated more than once on the max updated date.. what a mess..