This field is required.
Only these extensions are allowed(.jpg, .JPG, .jpeg, .JPEG, .gif, .GIF, .png, .PNG)
Tags cannot contain the characters ' /, \\, #, ?, or ; >,< '
Only these extensions are allowed(.zip,.ZIP,.pdf,.PDF,.qvf,.QVF,.qvw,.QVW)
Discussion Board for collaboration related to QlikView App Development.
I have a dataset that looks like the following:
Basically I need to calculate the overall profit/loss for the last two time periods for each date by Country e.g. the result for England would be:
22/05:10.00+25.00 (only last 2 values)
-15.00+100.00 (only last 2 values)
In a straight table I have added 'Country' as my dimension but I need the code for the expression to calculate the total profit for each country. Any ideas?
Hope the attached will help you
Need some script modification to find the last 2 values.
(html, codepage is 1252, embedded labels, table is @1);
AutoNumber(Time, Date & Country) AS TimeperiodNumber
Order by Date, Time Desc;
DROP Table Raw;
View solution in original post
I have added the expression:
This equates to the full profit/loss total for each date by Country. How can I get the total for only the last 2 rows for each date?
e.g. 22/05 - I have 10 rows but I only want the total profit for the last 2 rows?
Try: =Aggr(RangeSum(Above(TOTAL Sum([Profit]),0,2)),Date,Country)
Thanks tresesco but still now working for me
I am using Date and Country as my Dimensions.
I have the following expression:
Aggr(RangeSum(Above(TOTAL Sum(Profit,0,2)),Date,Country). If I remove the TOTAL from this expression I get the total for all countries by Date. However I require the total for the last 2 rows grouped by Date/Country.
Any other ideas?
Could you post your sample ?
I used a combination of Order By and AutoNumber(). See the file attached.
Hope it helps!