Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I'm having an issue where i'm not finding an solution for it. The challenge is the following:
The problem resides between those two steps. I needed to create an new measure that would be an running sum of some of those columns.
ex:
Day | value | rum_sum |
1 | 3 | 3 |
2 | 5 | 8 |
3 | 2 | 10 |
I've loaded all the qvd's and tried to make one new column with an formula from the resident table but without success.
I'm new to Qlikview so i'm probably missing some part.
Thanks,
Try using peek() or previous() functions in your load statement:
LOAD
Day,
value,
rangesum(peek(rum_sum),value) as rum_sum
RESIDENT Table;
Try using peek() or previous() functions in your load statement:
LOAD
Day,
value,
rangesum(peek(rum_sum),value) as rum_sum
RESIDENT Table;
Thanks it did work! For the case i placed above but my issue got a little bit more complex. Is it possible to make this way?
day | country | value | run_sum |
1 | US | 3 | 3 |
1 | France | 4 | 4 |
2 | US | 7 | 10 |
2 | France | 2 | 6 |
Just a little sorting and more checking with peek() function:
DAYS:
LOAD * INLINE [
day, country, value
1, US, 3
1, France, 4
2, US, 7
2, France, 2
];
LOAD *,
if(peek(country)=country,rangesum(peek(run_sum),value),value) as run_sum
Resident DAYS
order by country, day asc;
drop table DAYS;
Thanks again swuehl.
Just to conclude after this running sum with partitioning of the variable country i had to create an expression to get the correct value per day independently of where i was drilling.
The expression should be something like this: sum(aggr(max(run_sum),COUNTRY,DAY))