Discussion Board for collaboration on QlikView Scripting.
Hi, how should the script be like if I want to add up the balance(refer below) for 1 Jan 14 and 1 Feb 14, 1 Feb 14 and 1 Mar 14, etc,...?
It should be something like:
From <> Group By ....;
Date(MonthStart(date#(month, 'd mmm-yyyy'))) As month
intemnum, balance, month
2, 3, 1 Jan-14
2, 10, 1 Feb-14
2, 6, 1 Mar-14
2, 4, 1 Apr-14
2, 8, 1 May-14
If(itemnum = Previous(itemnum), Alt(Previous(balance), 0), 0) + balance As cum2months
DROP Table T_Data;
load * inline[itemnum,balance,month 2,3,1-Jan-14 2,10,1-Feb-14 2,6,1-Mar-14 2,4,1-Apr-14 2,8,1-May-14 ];2:load *,date(Date#(month,'DD-MMM-YY'),'M/D/YY') AS DATEResident 1;DROP Table 1;DROP Field month;LOAD if(Previous(DATE)=AddMonths(DATE,-1),balance+Previous(balance),0) as newResident 2;
if I were to use aggr function, how do I go about it?
hey thanks! but if I were to use aggr function, how do I go about it?
You mean, want this in the front -end. Aggr() might not be required. Create a sample qvw and share here explaining the expected output.
Hi, this is the expected output:
where 'avg balance'=sum(balance)/2 for 1 Jan-14 and 1 Feb-14, 1 Feb-14 and 1 Mar-14, etc,...
If(rowno()<>NoOfRows(), RangeAvg(Sum(balance), Above(Sum(balance),-1)))