Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm having trouble with Storing fields in a file. I'm not sure how to explain this but here's an attempt;
mytable:
Load *,
Year(Date)&num(week(Date),00) as YearWeek,
count(Counter) as Numberof,
sum(Credits) as Credits,
(sum(Price)-sum(Credits)) as [Price - Credits]
;
LOAD
Price,
Counter,
Credits,
Date
FROM
Store mytable into mytable.txt (txt);
Drop mytable;
I want to have YearMonth as a dimension and then the other fields as expressions. When I've tried to load this one QlikView freezes and then crashes.
How do I do this?
Thank you
/A.
Hi Anykay,
I am afraid that you cannot use aggregate functions in a Load statement without a group by clause.
I also don't think we can use aggregate functions in a Preceding load as you have used. Try to use those functions in a table expression.
Hi,
Or you can have a separate load statement for the functions above. If you are grouping the aggrgation based on the dates then :
mytable:
Load *,
Year(Date)&num(week(Date),00) as YearWeek
;
LOAD
Price,
Counter,
Credits,
Date
FROM
mytable_temp:
Load Date,
count(Counter) as Numberof,
sum(Credits) as Credits,
(sum(Price)-sum(Credits)) as [Price - Credits]
Resident mytable group by Date;
;
Store mytable_temp into mytable.txt (txt);