Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have an SQL Query and i am having difficulties with the Group By clause can anyone tell me how to handle it in click sense regards,
SELECT SUM (NUMBEROFCALLS) NUMBEROFCALLS,
SUM (NUMBER_OF_PRODUCTIVE_CALLS) NUMBER_OF_PRODUCTIVE_CALLS
FROM ( SELECT COUNT (PSS.STATUS_ID) NUMBEROFCALLS,
COUNT (DELIVERY.HEADER_ID) NUMBER_OF_PRODUCTIVE_CALLS,
PSS.TRN_DATE,
OUTLET_CODE
FROM PRE_SALE_STATUS PSS,
SHOP_STATUS SS,
OUTLET O,
DISTRIBUTOR D,
(SELECT S.HEADER_ID
FROM SALES S, SALES_DETAIL_VI SD
WHERE S.ID = SD.HEADER_ID AND SD.ORDER_QTY > 0
GROUP BY S.HEADER_ID) DELIVERY
WHERE PSS.STATUS_ID = SS.ID
AND PSS.OUTLET_CODE = O.CODE
AND PSS.DIST_CODE = D.CODE
AND PSS.ID = DELIVERY.HEADER_ID(+)
AND PSS.TRN_DATE BETWEEN :FDATE AND :TDATE
AND D.REGION_ID = NVL ( :P_REGION_LIST, D.REGION_ID)
--AND D.DISTRICT_ID=NVL(:P_DISTRICT_LIST,D.DISTRICT_ID)
AND D.TOWN_ID = NVL ( :P_TOWN_LIST, D.TOWN_ID)
AND D.CODE = NVL ( :P_DIST_CODE, D.CODE)
AND O.R_CODE = NVL ( :P_ROUTE_ID, O.R_CODE)
--&H_EMP
GROUP BY PSS.TRN_DATE, O.R_CODE, OUTLET_CODE)
You cans use
SQL select
......
.......
your queries
.....
;
and your group by will be handled by SQL
If you want group by in Qlik you need to group it by all the available dimension else it will throw error.
On a lighter note It's Qlik Sense, You may want to correct it.
-Pradosh
remove "O.R_CODE" from group By
Thank You For your reply......I don't want to use SQL in Qlik at all just wanna implement the logic of this query in Qlik Scripting.How to do that??
Thanks
Hello,
Why??
Hello,
Thank You For your reply.....I just want to implement this query logic in Qlik using Qlik Scripting....How to do that Thanks??