Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have 2 date fields in my datamodel:
1 date field value is having multiple 2nd date field value as shown below:
DateField1 DateField2
24/07/2014 | 24/07/2014 |
24/07/2014 | 25/07/2014 |
24/07/2014 | 29/07/2014 |
24/07/2014 | 04/08/2014 |
25/07/2014 | 24/07/2014 |
25/07/2014 | 25/07/2014 |
25/07/2014 | 29/07/2014 |
25/07/2014 | 04/08/2014 |
29/07/2014 | 24/07/2014 |
29/07/2014 | 25/07/2014 |
29/07/2014 | 29/07/2014 |
29/07/2014 | 04/08/2014 |
04/08/2014 | 24/07/2014 |
04/08/2014 | 25/07/2014 |
04/08/2014 | 29/07/2014 |
04/08/2014 | 04/08/2014 |
11/08/2014 | 24/07/2014 |
11/08/2014 | 25/07/2014 |
11/08/2014 | 29/07/2014 |
11/08/2014 | 04/08/2014 |
Now the requirement is when i use the datefield1 as the dimension and i need to get the below output for datefield2 in a straight table
Datefield1 | DateField2 |
24/07/2014 | 24/07/2014 |
25/07/2014 | 25/07/2014 |
29/07/2014 | 29/07/2014 |
04/08/2014 | 04/08/2014 |
11/08/2014 | null |
Check this qvw
What is the logic you want to use. There seems to be a mix of MIN, MAX and something else for the 11th
Check this qvw
Maybe it's just an if:
If(DateField2=DateField1, DateField2)
I think you can't use set analisys to make that comparison (a different value for each row)
For each datefield1 value- i need the matching datefield2 value,if the matching value is not there then it should be null.
Both the Datefield1 and Datefield2 values should be same if there exists a value for Datefield2,
Thanks anbu.It worked as expected
@Ruben Marin's Solution will work but I will advise you to modify the script and to create a new column with a flag when the two dateFields are matching:
LOAD *
if(DateField2=DateField1,1,0) as Flag
from [...];
Then you can write your set analysis like
sum({<Flag={1}>}fieldToSum)
This way you will follow Qlikview guidelines and the performance will be better.
Cheers
Dany