Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have to build a script to create a table like this:
Gourp | Detail | Flag (to create) |
---|---|---|
10 | 5 | 1 |
10 | 4 | 2 |
10 | 3 | 3 |
11 | 8 | 1 |
11 | 7 | 2 |
11 | 5 | 3 |
12 | 10 | 1 |
12 | 3 | 2 |
The table key is the fields union Group and Detail, the Flag field is the one I have to generate.
For each Group different value must have the Flag field is renewed and assumes a progressive function of the Detail field.
Can you tell me at least one function that can help me?
Bye and thanks
One More approach..
Load *,AutoNumber(RecNo(),Gourp) as Flag;
LOAD Gourp,
Detail
FROM
[https://community.qlik.com/thread/192818]
(html, codepage is 1252, embedded labels, table is @1);
This?
Table:
LOAD *,
If(Gourp = Previous(Gourp), RangeSum(Peek('Flag'), 1), 1) as Flag;
LOAD Gourp,
Detail
FROM
[https://community.qlik.com/thread/192818]
(html, codepage is 1252, embedded labels, table is @1);
One More approach..
Load *,AutoNumber(RecNo(),Gourp) as Flag;
LOAD Gourp,
Detail
FROM
[https://community.qlik.com/thread/192818]
(html, codepage is 1252, embedded labels, table is @1);
Hey Settu
Would you be able to guide me on how can I share script like this?
I have tried to do this before, but not really sure how this format can be applied while pasting a script.
Thanks,
Sunny
Hi Sunny,
in the Advanced Editor..
Oh okay, thank you so much
No Problem 🙂
Thanks all
AutoNumber(RecNo(),Gourp) as Flag
is really, really neat!