Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
RimDataAnalyst
Contributor III
Contributor III

Group by in script loading

Hello ,
I have a table where for some dimensions I don't have the same value, so in my script I want to filter and keep only the first row. here is an example of the data file: 

for this exemple i want to load only the row with the 

RimDataAnalyst_0-1662711362186.png

i want to order and GRoup by ATA 6D  then filter and keep only the first row , this is my script actually : 

unqualify *;
parts_va_source:
LOAD Distinct
[AC Type / AC SubType / ATA 6D] as ID,
[AC Type],
[AC SubType],
[ATA 2D],
[ATA 6D],
[Network Disruption],
[Unplanned maintenance],
Fuel,
[Inventory management],
[Technical Operations],
[Asset Management],
Partner
;
SELECT [AC Type / AC SubType / ATA 6D],[AC Type],[AC SubType],[ATA 2D],[ATA 6D],[Network Disruption],[Unplanned maintenance],Fuel,[Inventory management],[Technical Operations],
[Asset Management],Partner
FROM GetSheetValues
WITH PROPERTIES (
spreadsheetKey='1ThWGbQC3ccRhzi_w7fXA0BIx8HkW',
range='PartsA1:O',
valueRenderOption='FORMATTED_VALUE',
dateTimeRenderOption='FORMATTED_STRING',
generatedNumberedColumns='false',
skipRows=''
);

Thank you for your help 

Labels (3)
1 Reply
SerhanKaraer
Creator III
Creator III

Hello,

You can either use firstsortedvalue function with suitable ranking

https://help.qlik.com/en-US/sense/August2022/Subsystems/Hub/Content/Sense_Hub/Scripting/AggregationF...

or autonumbers' second parameter to partition records and filter necessary records afterwards.

https://help.qlik.com/en-US/sense/August2022/Subsystems/Hub/Content/Sense_Hub/Scripting/CounterFunct...