Created
September 9, 2014 19:39
-
-
Save pedroelsner/90af693bd42c98001428 to your computer and use it in GitHub Desktop.
Script Qlikview para Alexandre Gabriel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original: | |
LOAD * INLINE [ | |
Objeto, ID | |
Ref1, 13 | |
Ref1, 16 | |
Ref1, 19 | |
Ref1, 32 | |
]; | |
Temp: | |
LOAD Distinct | |
Objeto & '.' & ID AS LinhaID | |
, Objeto | |
, ID | |
Resident Original; | |
Left Join (Temp) | |
LOAD Distinct | |
Objeto | |
, ID AS OUTROS_IDs | |
Resident Original; | |
Left Join (Temp) | |
LOAD Distinct | |
LinhaID | |
, if(OUTROS_IDs < ID, OUTROS_IDs, Null()) AS MAX_MIN_ID | |
Resident Temp; | |
DROP Table Original; | |
Final: | |
LOAD Distinct | |
Objeto & '.' & ID AS LinhaID | |
, Objeto | |
, ID | |
Resident Temp; | |
Left Join (Final) | |
LOAD LinhaID | |
, Max(MAX_MIN_ID) AS MAX_ID | |
, Min(MAX_MIN_ID) AS MIN_ID | |
Resident Temp | |
Group by LinhaID; | |
DROP Table Temp; | |
DROP Field LinhaID FROM Final; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment