Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I've read a lot about the function firstsortedvalue() but do not get the expected result.
I have a table with 4 fields.
- PrognoseID (1-150)
- Article (numbers)
- Flag A: letters
- Flag B: letters
Example
Article | PrognoseID | FlagA | FlagB |
14417 | 128 | c | a |
14417 | 92 | c | a |
14417 | 81 | c | a |
14470 | 135 | o | a |
14470 | 119 | o | a |
14470 | 87 | o | a |
Some Articles are in different IDs with different Flags.
My goal is to have Flag A and B for each Article based on the highest ID number. For Article 14417 this would be c & a from PrognoseID 128.
For some reason, my ressult is blanc entries for Flag A & B for most of the articles. I hope one of you can help me.
Below the script;
Sortiment_Temp:
LOAD PrognoseID,
Article,
FlagA,
FlagB
FROM
[..\03_Datasource\Sortiment.qvd]
(qvd) ;
NoConcatenate
Sortiment:
Load
max(PrognoseID) as PrognoseID,
Article,
FirstSortedValue(FlagA,PrognoseID) as FlagA
FirstSortedValue(FlagB,PrognoseID) as FlagA
Resident Sortiment_Temp
Group by Article
May be you are using an older version of QlikView because I don't see the red wiggly lines. I think they updated the syntax editor with QV12 release