Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have a requirement like i have field Year in that i have two years.if i click on year one it should show accumulate on total and if i click on second year it should accumulate previous year and present year,so how to do in script level ?
Find bow attachment.and give me some valid examples,,,Its Urgent,,
Please check the attached qvw. Note, here order of data load matters.
Please check the attached qvw. Note, here order of data load matters.
Hi Tresesco,
Could you please explain what this piece of code is doing?:
Load
State,
MonthName(MonthYear) as MonthYear,
Sales,
If(State=Peek(State), RangeSum(Sales,Peek('NewSales')), Sales) as NewSales;
I am a bad teacher outside classroom. And a lazy long writer too. . Still I would try to explain.
Assuming you are more interested in the last line of the code segment. It checks if the current row State is same as the one last loaded, if they are same the a new field NewSales would be created that calculates as the sum of two units - the previous NewSales and the current Sales. This eventually accumulates the earlier sales because the NewSales is actually recursive; the earlier one has all the earliers. If the IF condition fails, i.e. - earlier state is not same with the current state (this will only happen for the first row for new state), we need not accumultate (other state's sale should not considered in another state).
Hoe this helps.
Thanks. It is clear now:)