Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I'm new to qlikview and I'm trying to map a field to a table, but I'm struggling to get it to work. This is what I'm trying to do:
Table1:
| A | B | C | D |
| X1 | 1 | 01/01/2012 | 10/10/2012 |
| X2 | 2 | 04/06/2011 | 02/02/2012 |
| X3 | 4 | 03/09/2011 | 07/07/2012 |
| X4 | 6 | 10/06/2011 | 01/05/2012 |
| X5 | 6 | 01/04/2011 | 31/03/2012 |
| X3 | 6 | 25/04/2011 | 22/07/2011 |
| X6 | 3 | 10/08/2011 | 10/06/2012 |
| X7 | 0 | 30/04/2011 | 20/09/2011 |
| X2 | 1 | 03/03/2012 | 04/04/2012 |
Table2:
| A | E |
| X2 | 03/09/2011 |
| X3 | 20/03/2012 |
| X4 | 01/01/2012 |
| X5 | 12/12/2011 |
| X6 | 20/01/2012 |
| X7 | 10/05/2012 |
| X2 | 10/03/2012 |
I need to map field B to Table 2, however; the outcome must be dependant upon the date in field E falling between the dates in fields C and D.
This is what the outcome should be:
| A | E | B2 |
| X2 | 03/09/2011 | 2 |
| X3 | 20/03/2012 | 4 |
| X4 | 01/01/2012 | 6 |
| X5 | 12/12/2011 | 6 |
| X6 | 20/01/2012 | 3 |
| X7 | 10/05/2012 | 0 |
| X2 | 10/03/2012 | 1 |
Any help would be much appreciated.
Thanks
Stephanier,
I have just had a quick look at this. I have attached a qvw which should give the result you are looking for.
Based upon the above data, you join the two table and then via an 'if' statement you look for where E is not less than C or more than D. Where this fits you return B, where it doesnt you return somthing like 'ERROR'.
You can then reload the table to exlude where 'ERROR' is shown.
I'm sure there could be neater ways to do this that somone else may be able to advise.
Many thanks