Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
aj0031724
Partner - Creator
Partner - Creator

Group data from master table and do calculation IN LOAD SCRIPT

Team,

We need to group data based on KPI,RNC,UTRANCELL,DATE,site  from master table and apply some LOGIC AS BELOW FOR OUTPUT:

  if(Previous(RESULT) >4 and RESULT > 4,'Alarmed',
if(-rangesum((RESULT >4),(peek(RESULT,-1)>4),(peek(RESULT,-2)>4),(peek(RESULT,-3)>4),(peek(RESULT,-4)>4),(peek(RESULT,-5)>4),(peek(RESULT,-6)>4))>=4,'Highly utilized',

   if(-rangesum((RESULT<3),(peek(RESULT,-1)<3),(peek(RESULT,-2)<3),(peek(RESULT,-3)<3),(peek(RESULT,-4)<3),(peek(RESULT,-5)<3),(peek(RESULT,-6)<3))>=6,'Low utilized',

    'Standard'))) as Classification

I am unable to do SO .Can you please suggest /advice how to implement this in load script.

I nned the classification to be grouped based on  KPI,RNC,UTRANCELL,DATE,site  as highlighted in color sets.

data sets example:

   

_KPI_NAME_GenericKpisActivatedByUserUTRANCELLRNCDATESITERESULTCLASSIFICATION
COMB CS DROPSASESP22DPP1R0106.12.14ASESP3
COMB CS DROPSASESP22DPP1R0106.13.14ASESP4
COMB CS DROPSASESP22DPP1R0106.14.14ASESP11
COMB CS DROPSASESP22DPP1R0106.15.14ASESP1
COMB CS DROPSASESP22DPP1R0106.16.14ASESP7
COMB CS DROPSASESP22DPP1R0106.17.14ASESP5
COMB CS DROPSASESP22DPP1R0106.18.14ASESP1
COMB CS DROPSASESP22DPP1R0106.19.14ASESP8
COMB CS DROPSASESP22DPP1R0106.20.14ASESP7
COMB CS DROPSASESP22DPP1R0106.21.14ASESP1
COMB CS DROPSASESP22DPP1R0106.22.14ASESP2
COMB CS DROPSASESP22DPP1R0106.23.14ASESP10
COMB CS DROPSASESP22DPP1R0106.24.14ASESP1
COMB CS DROPSASESP22DPP1R0106.25.14ASESP19
COMB CS DROPSASESP22DPP1R0106.26.14ASESP2
COMB CS DROPSASESP22DPP1R0106.27.14ASESP4
COMB CS DROPSASESP22DPP1R0106.28.14ASESP1
COMB CS DROPSASESP22DPP1R0106.29.14ASESP2
COMB CS DROPSASESP22DPP1R0106.30.14ASESP22
COMB CS DROPSASESP22DPP1R0107.01.14ASESP3
COMB CS DROPSATACM22DPP1R0106.12.14ATACM9
COMB CS DROPSATACM22DPP1R0106.13.14ATACM9
COMB CS DROPSATACM22DPP1R0106.14.14ATACM11
COMB CS DROPSATACM22DPP1R0106.15.14ATACM5
COMB CS DROPSATACM22DPP1R0106.16.14ATACM6
COMB CS DROPSATACM22DPP1R0106.17.14ATACM12
COMB CS DROPSATACM22DPP1R0106.18.14ATACM5
COMB CS DROPSATACM22DPP1R0106.19.14ATACM7
COMB CS DROPSATACM22DPP1R0106.20.14ATACM5
COMB CS DROPSATACM22DPP1R0106.21.14ATACM1
COMB CS DROPSATACM22DPP1R0106.22.14ATACM4
COMB CS DROPSATACM22DPP1R0106.23.14ATACM2
COMB CS DROPSATACM22DPP1R0106.24.14ATACM5
COMB CS DROPSATACM22DPP1R0106.25.14ATACM7
COMB CS DROPSATACM22DPP1R0106.26.14ATACM15
COMB CS DROPSATACM22DPP1R0106.27.14ATACM9
COMB CS DROPSATACM22DPP1R0106.28.14ATACM6
COMB CS DROPSATACM22DPP1R0106.29.14ATACM4
COMB CS DROPSATACM22DPP1R0106.30.14ATACM6
COMB CS DROPSATACM22DPP1R0107.01.14ATACM9
3 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

The syntax of your expression looks OK, but it will assume that the data is correctly sorted.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
aj0031724
Partner - Creator
Partner - Creator
Author

Dear Jonathan,

Yes the master table contains data as shown above in sorted order.

Now I need to do classification grouped by KPI,RNC,UTRANCELL,DATE,site .

How can I use group by in load for the above classification .

Can you please advise?

aj0031724
Partner - Creator
Partner - Creator
Author

Dear Team,

Can you please guide me with the above ?