Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Community,
this is my first question as QlikView newbie in this group so ... HURRA This is my question:
I have a table, which contains data sets from 01.01.2017 to today. For example, the following inline table:
TEST_TABLE:
LOAD* INLINE
[
Date, value
2017.04.17, 26
2017.04.18, 2
2017.04.19, 37
2017.04.20, 41
2017.04.21, 85
2017.04.22, 44
2017.04.23, 67
2017.04.24, 1
2017.04.25, 58
2017.04.26, 45
2017.04.27, 28
2017.04.28, 73
2017.04.29, 55
2017.04.30, 92
2018.04.18, 49
2018.04.19, 99
2018.04.20, 81
2018.04.21, 66
2018.04.22, 69
2018.04.23, 57
2018.04.24, 10
2018.04.25, 22
2018.04.26, 75
2018.04.27, 61
2018.04.28, 37
2018.04.29, 39
2018.04.30, 15
];
Now to the task: the current day should be compared to the value of the previous year. So should stand for the 2018.04.23 the value 57 and in the next column, the value 67 for the 2017/04/23. We can solve this scenario in the script or on the surface in a table with a formula. In order to learn something, I would like to see both possibilities as well
The result should look like this:
Date | Value | Last Year |
---|---|---|
2018.04.23 | 57 | 67 |
2018.04.24 | 10 | 1 |
2018.04.25 | 22 | 58 |
2018.04.26 | 75 | 45 |
2018.04.27 | 61 | 28 |
2018.04.28 | 37 | 73 |
2018.04.29 | 39 | 55 |
I hope the example of my problem is well explained and I look forward to feedback on my first post
Best regards
David
hello
you can try that
left join(TEST_TABLE)
load
AddYears(Date,+1) as Date,
value as Hist_value
resident TEST_TABLE;
For doing this in the script, I would suggest looking into The As-Of Table
hello
you can try that
left join(TEST_TABLE)
load
AddYears(Date,+1) as Date,
value as Hist_value
resident TEST_TABLE;
Very interesting link! Thank you!
This works fine in the script! Thank you very much!