Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
rafael5958
Creator
Creator

show max from group in graph table

I have a graphic table as this

reqSIT/IDreqOper/IDencamReq/NOME_OPERencamReq/DATAresult/DATA_FIM_CARGAresult/TIPO_RESULTADOtempo Resp ( D  HH:mm:ss)
       411:16:05
300843008MMMMM12/09/2016 10:52:2407/10/2016 14:44:58P 603:51:41
300843008MMMMM12/09/2016 10:52:2411/10/2016 18:29:15P 703:36:27
300943009MMMMM12/09/2016 10:52:2507/10/2016 14:45:10P 603:51:41
301043010MMMMM12/09/2016 10:52:2507/10/2016 14:45:39P 603:51:42
301143011MMMMM12/09/2016 10:52:2507/10/2016 14:44:02N 603:51:37
301243012MMMMM12/09/2016 10:52:2507/10/2016 14:45:31P 603:51:42
301343013MMMMM12/09/2016 10:52:2507/10/2016 14:45:22P 603:51:41
301443014MMMMM12/09/2016 10:52:2607/10/2016 14:44:05N 603:51:37
301543015MMMMM12/09/2016 10:52:2607/10/2016 14:44:03N 603:51:37

 

The first two rows show same values, only difference is in result/DATA_FIM_CARGA. I must show only the higher result/DATA_FIM_CARGA. How can i do that?

 

Should be:

reqSIT/IDreqOper/IDencamReq/NOME_OPERencamReq/DATAresult/DATA_FIM_CARGAresult/TIPO_RESULTADOtempo Resp ( D  HH:mm:ss)
       411:16:05
300843008MMMMM12/09/2016 10:52:2411/10/2016 18:29:15P 703:36:27
300943009MMMMM12/09/2016 10:52:2507/10/2016 14:45:10P 603:51:41
301043010MMMMM12/09/2016 10:52:2507/10/2016 14:45:39P 603:51:42
301143011MMMMM12/09/2016 10:52:2507/10/2016 14:44:02N 603:51:37
301243012MMMMM12/09/2016 10:52:2507/10/2016 14:45:31P 603:51:42
301343013MMMMM12/09/2016 10:52:2507/10/2016 14:45:22P 603:51:41
301443014MMMMM12/09/2016 10:52:2607/10/2016 14:44:05N 603:51:37
301543015MMMMM12/09/2016 10:52:2607/10/2016 14:44:03N 603:51:37
Labels (1)
1 Solution

Accepted Solutions
Saravanan_Desingh

One solution through Script..

tab1:
LOAD "reqSIT/ID", "reqOper/ID", "encamReq/NOME_OPER", "encamReq/DATA", 
	Timestamp#("result/DATA_FIM_CARGA",'MM/DD/YYYY hh:mm:ss') As "result/DATA_FIM_CARGA", 
	"result/TIPO_RESULTADO", "tempo Resp ( D  HH:mm:ss)"
;
LOAD * INLINE [
    "reqSIT/ID", "reqOper/ID", "encamReq/NOME_OPER", "encamReq/DATA", "result/DATA_FIM_CARGA", "result/TIPO_RESULTADO", "tempo Resp ( D  HH:mm:ss)"
     ,  ,  ,  ,  ,  ,  411:16:05
    3008, 43008, MMMMM, 12/09/2016 10:52:24, 07/10/2016 14:44:58, P,  603:51:41
    3008, 43008, MMMMM, 12/09/2016 10:52:24, 11/10/2016 18:29:15, P,  703:36:27
    3009, 43009, MMMMM, 12/09/2016 10:52:25, 07/10/2016 14:45:10, P,  603:51:41
    3010, 43010, MMMMM, 12/09/2016 10:52:25, 07/10/2016 14:45:39, P,  603:51:42
    3011, 43011, MMMMM, 12/09/2016 10:52:25, 07/10/2016 14:44:02, N,  603:51:37
    3012, 43012, MMMMM, 12/09/2016 10:52:25, 07/10/2016 14:45:31, P,  603:51:42
    3013, 43013, MMMMM, 12/09/2016 10:52:25, 07/10/2016 14:45:22, P,  603:51:41
    3014, 43014, MMMMM, 12/09/2016 10:52:26, 07/10/2016 14:44:05, N,  603:51:37
    3015, 43015, MMMMM, 12/09/2016 10:52:26, 07/10/2016 14:44:03, N,  603:51:37
];

Right Join(tab1)
tab2:
LOAD [reqSIT/ID], [reqOper/ID], 
	Timestamp(Max("result/DATA_FIM_CARGA"),'MM/DD/YYYY hh:mm:ss') As "result/DATA_FIM_CARGA"
Resident tab1
Group By [reqSIT/ID], [reqOper/ID]
;

commQV53.PNG

View solution in original post

2 Replies
rafael5958
Creator
Creator
Author

If I use: 

if((Max(aggr(max([result/ID]), [reqOper/ID])))-[reqOper/ID]=0,[result/ID],(Max(aggr(max([result/ID]), [reqOper/ID]))))

 

It shows me :

reqSIT/IDreqOper/IDencamReq/NOME_OPERADORAencamReq/DATAresult/DATA_FIM_CARGAresult/DATA_RECEBIMENTOresult/TIPO_RESULTADOresult/IDtempo Resp ( Dias HH:mm:ss)//if(Max(aggr(Sum([result/ID]), [reqOper/ID]))=null(),null(),[reqOper/ID])

//Max(aggr(max([result/ID]), [reqOper/ID]))


//if([result/ID]= Max(aggr(Sum([result/ID]), [reqOper/ID] )), [result/ID], '0' )



if((Max(aggr(max([result/ID]), [reqOper/ID])))-[reqOper/ID]=0,[result/ID],(Max(aggr(max([result/ID]), [reqOper/ID]))))
         337:20:58 
156241562MMM19/01/2016 13:49:1022/01/2016 11:46:0922/01/2016 11:45:09N47502971 69:55:5947698783
156241562MMM19/01/2016 13:49:1005/02/2016 18:15:1805/02/2016 18:15:10N47698763 412:26:00-
156241562MMM19/01/2016 13:49:1010/02/2016 15:40:5410/02/2016 15:30:06P47698783 529:40:56-

 

But still shows and count the null cell, I dont want it, I want to remove it, is there a way?

Saravanan_Desingh

One solution through Script..

tab1:
LOAD "reqSIT/ID", "reqOper/ID", "encamReq/NOME_OPER", "encamReq/DATA", 
	Timestamp#("result/DATA_FIM_CARGA",'MM/DD/YYYY hh:mm:ss') As "result/DATA_FIM_CARGA", 
	"result/TIPO_RESULTADO", "tempo Resp ( D  HH:mm:ss)"
;
LOAD * INLINE [
    "reqSIT/ID", "reqOper/ID", "encamReq/NOME_OPER", "encamReq/DATA", "result/DATA_FIM_CARGA", "result/TIPO_RESULTADO", "tempo Resp ( D  HH:mm:ss)"
     ,  ,  ,  ,  ,  ,  411:16:05
    3008, 43008, MMMMM, 12/09/2016 10:52:24, 07/10/2016 14:44:58, P,  603:51:41
    3008, 43008, MMMMM, 12/09/2016 10:52:24, 11/10/2016 18:29:15, P,  703:36:27
    3009, 43009, MMMMM, 12/09/2016 10:52:25, 07/10/2016 14:45:10, P,  603:51:41
    3010, 43010, MMMMM, 12/09/2016 10:52:25, 07/10/2016 14:45:39, P,  603:51:42
    3011, 43011, MMMMM, 12/09/2016 10:52:25, 07/10/2016 14:44:02, N,  603:51:37
    3012, 43012, MMMMM, 12/09/2016 10:52:25, 07/10/2016 14:45:31, P,  603:51:42
    3013, 43013, MMMMM, 12/09/2016 10:52:25, 07/10/2016 14:45:22, P,  603:51:41
    3014, 43014, MMMMM, 12/09/2016 10:52:26, 07/10/2016 14:44:05, N,  603:51:37
    3015, 43015, MMMMM, 12/09/2016 10:52:26, 07/10/2016 14:44:03, N,  603:51:37
];

Right Join(tab1)
tab2:
LOAD [reqSIT/ID], [reqOper/ID], 
	Timestamp(Max("result/DATA_FIM_CARGA"),'MM/DD/YYYY hh:mm:ss') As "result/DATA_FIM_CARGA"
Resident tab1
Group By [reqSIT/ID], [reqOper/ID]
;

commQV53.PNG