Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I would like to add a grouped sequence number in the QlikView straight table and need some help.
I have the column A to F shown in the dimensions of a straight table and want to add a running sequence number expression that groups on only column A to C.
Please see the attached excel where I have manually added the sequence column. This column should not be there and should be generated in QlikView.
Please help. Thx!
Yes. You are correct. Sorry for giving an incorrect expression. Peek does not work in chart expressions. You should use 'Above' instead. An example is attached. Hope this helps.
Hi,
Try below code:
AutoNumber(rowno(),SAC.RouteDay) as Sequence
HTH
Sushil
In the script, try like:
Load
*,
AutoNumber(RowNo(),WeekDayNo) as Sequence
From <>;
Load *,AutoNumber(RecNo(),SAC.AddressNumberSalesStaff&WeekNo&WeekDayNo) As NewSeq;
LOAD SAC.AddressNumberSalesStaff,
WeekNo,
WeekDayNo,
SAC.AddressNumberCustomer,
SAC.CustomerName,
SAC.RouteDay,
Sequence
FROM
(biff, embedded labels, table is Sheet1$);
You can try to add like
AutoNumber(rowno(),SAC.RouteDay) as Sequence
Or
AutoNumber(rowno(),WeekDayNo&SAC.RouteDay) as Sequence
Regards
Anand
LOAD *,
AutoNumber(RecNo(),AutonumberHash128(SAC.AddressNumberSalesStaff,WeekNo,WeekDayNo)) as Sequence
FROM yoursource;
Thx all for the script! It works but I would like to be done in the expression of a straight table and there does not seem to have Autonumber function in expression.
I need it done in the expression because the user may filter the result and the expression can dynamically generate the sequence number.
Can advise further anyone?
The following script also works. If you want to implement Seq as chart expression, remove the preceding load in the script, sort the straight table by ID ascending and use the expression
If(Peek(SAC.RouteDay)=SAC.RouteDay,Peek(Seq)+1,1)
for your new sequence number column.
Data:
LOAD *,If(Peek(SAC.RouteDay)=SAC.RouteDay,Peek(Seq)+1,1) as Seq;
LOAD SAC.AddressNumberSalesStaff,
WeekNo,
WeekDayNo,
SAC.AddressNumberCustomer,
SAC.CustomerName,
SAC.RouteDay,
Sequence,
RecNo() as ID
FROM
(biff, embedded labels, table is Sheet1$);
Hi NagaianK,
Just tried in expression but Peek does not seem to be recognized in expression. Are you able to provide an example in qlikview?
Yes. You are correct. Sorry for giving an incorrect expression. Peek does not work in chart expressions. You should use 'Above' instead. An example is attached. Hope this helps.