Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I'm new to qlikview and i need some help with it.
I have a table with some records with dimension "Date" and "a".
What i want is to get values from dimensions "A" coresponding to same date from last month.
I know how to do this in script, but i want the same result using only expresions in a straight table.
for example:
Records:
Date | Value |
01-05-2012 | 5 |
02-05-2012 | 50 |
03-05-2012 | 17 |
01-06-2012 | 15 |
02-06-2012 | 30 |
03-06-2012 | 2 |
Result:
Date | A | Same Day LastM |
01-06-2012 | 15 | 5 |
02-06-2012 | 30 | 50 |
03-06-2012 | 2 | 17 |
I also attached an example on how to i did it with script .
Tnx in advance for help.
Hiiiii
See the attached file
Hope it helps
in your script
load
DATE(Date#(Date,'DD-MM-YYYY'),'DD/MM/YYYY') AS DATE,
DAY(Date#(Date,'DD-MM-YYYY')) AS Day,
Value
from mytable;
then in straight table--
calculateDimension-- =Aggr(max(DATE),Day)
Expression1--- Aggr(FirstSortedValue(Value,-DATE),Day)
Expression2-- Aggr(FirstSortedValue(Value,DATE),Day)
then outputlike this
Date | A | Same Day LastM |
- | - | |
01/06/2012 | 15 | 5 |
02/06/2012 | 30 | 50 |
03/06/2012 | 2 | 17 |
Hiiiii
See the attached file
Hope it helps
in your script
load
DATE(Date#(Date,'DD-MM-YYYY'),'DD/MM/YYYY') AS DATE,
DAY(Date#(Date,'DD-MM-YYYY')) AS Day,
Value
from mytable;
then in straight table--
calculateDimension-- =Aggr(max(DATE),Day)
Expression1--- Aggr(FirstSortedValue(Value,-DATE),Day)
Expression2-- Aggr(FirstSortedValue(Value,DATE),Day)
then outputlike this
Date | A | Same Day LastM |
- | - | |
01/06/2012 | 15 | 5 |
02/06/2012 | 30 | 50 |
03/06/2012 | 2 | 17 |
if your problem resolved then marked it as either correct or helpful according to your question so that it might be helpful for other developer.
Regards
Vishwaranjan