Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Expression to compare two fields

Hi,

Please i have a question

i have this table

DateNew DateField1Field2
2/1/2010?1A
3/1/2010?1B
4/1/2010?1A
5/1/2010?2B
6/1/2010?2A
7/1/2010?1B

i want an expression for the field New Date based on

if Field2 has a repeated value and the corresponding values in Field1 are equal

like the case 1,A and 1,A

so i want the New Date face these 2 records to be the minimum date of both

this is the final result i want

DateNew DateField1Field2
2/1/20102/1/20101A
3/1/20103/1/20101B
4/1/20102/1/20101A
5/1/20105/1/20102B
6/1/20106/1/20102A
7/1/20103/1/20101B

Thanks in Advance

Labels (1)
1 Solution

Accepted Solutions
lironbaram
Partner - Master III
Partner - Master III

hei attach is an example

View solution in original post

4 Replies
lironbaram
Partner - Master III
Partner - Master III

hei attach is an example

Not applicable
Author

Thanks so much for your help

but what if i want this case

DateNew DateField1Field2
2/1/2010?1A
3/1/2010?1B
4/1/2010?1Ax
5/1/2010?2B
6/1/2010?2A
7/1/2010?1By

and i want to compare A after removing x from it with A in the other record and if they are equal to apply the last situation,the same also for B after removing y from  it to compare it with B

i.e the final result will also be

DateNew DateField1Field2
2/1/20102/1/20101A
3/1/20103/1/20101B
4/1/20102/1/20101Ax
5/1/20105/1/20102B
6/1/20106/1/20102A
7/1/20103/1/20101By
lironbaram
Partner - Master III
Partner - Master III

then i would recomend you to go and create a new field in the load script

that will be something like

left(Field2,1) as Field3

then use Field 3 in the expression

Not applicable
Author

Thanks so much for your help