Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
HI All,
I have below sample code .But the max is not working with the applymap.Getting an error in script execution.
Regiongrouping:
mapping load
Region,
(max(orderdate))
FROM
(biff, embedded labels)
group by Region;
OderData:
LOAD Region,
orderdate,
applyMap ('Regiongrouping', Region) as [Max oderdate],
value,
comment
FROM
(biff, embedded labels);
Why is this so?
Can you attach your Test.xls file for testing out your code?
Best,
Sunny
What is the error message?
Instead of mapping load, you can use Left join like below
OderData:
LOAD Region,
orderdate,
value,
comment
FROM
(biff, embedded labels);
Left Join(OderData)
Load Region,max(orderdate) As [Max oderdate] Resident OderData Group by Region;
Hi,
Why don't you remove the bracket from behind Max, See below
Regiongrouping:
mapping load
Region,
max(orderdate)
FROM
(biff, embedded labels)
group by Region;
OderData:
LOAD Region,
orderdate,
applyMap ('Regiongrouping', Region) as [Max oderdate],
value,
comment
FROM
(biff, embedded labels);
your code works on my QlikView and with some test data (test.xls)
could you post your excel and the error?
I would ensure you have a field name on the Max in the ApplyMap. It's strange that it's inconsistent if this falls over or not, but I would certainly add it for completeness:
(max(orderdate)) as OD,
As Gabsus04 states the brackets are superflous, but will not cause an issue.
The name of the field in the ApplyMap is not used anywhere - but it is probably better to have it.
Steve