Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Syntax Qlikview

Hello,

I'm new in QlikView .  Can you help me to adapt this SQL for QlikView?



PEDIDOS FINALIZADOS
:

SELECT IPD_NUMPED FROM ITPEDIDOS

WHERE IPD_CDEMP = 1

AND IPD_TPPED = 'V'

GROUP BY IPD_NUMPED

HAVING SUM(IPD_BASE) > 0


PEDIDO PENDENTE TOTAL (NENHUMA QUANTIDADE ENTREGUE)

SELECT IPD_NUMPED FROM ITPEDIDOS

WHERE IPD_CDEMP = 1

AND IPD_TPPED = 'V'

GROUP BY IPD_NUMPED

HAVING SUM(IPD_QTDENT) =0 AND SUM(IPD_BASE) = 0


Thanks.






1 Solution

Accepted Solutions
IAMDV
Luminary Alumni
Luminary Alumni

Hi,

Thanks for clarifying! Here we go...

Bad News: There is NO Having clause in QlikView

Good News: We can still solve this by using Where clause and the Preceding Load.

I've made a video tutorial sometime back and hopefully it will answer your question.

http://qlikshare.com/qlikview-video-tutorial-clause-qlikview/

However, you syntax will look something like this...

//This is Preceding Load

LOAD

    *

WHERE IPD_BASE >0;

// This is main Load

LOAD

    IPD_NUMPED,

    SUM(IPD_BASE) AS IPD_BASE

From ITPEDIDOS

WHERE

PD_CDEMP = 1

AND IPD_TPPED = 'V'

FROM TableName

GROUP BY IPD_NUMPED;


I hope this helps!

Cheers,

DV

View solution in original post

8 Replies
SunilChauhan
Champion
Champion

Create connection string using OLeDb and use direct below query

and reload it will give your result

Sunil Chauhan
bbi_mba_76
Partner - Specialist
Partner - Specialist

Hi,

in the first query you are selecting only a field  (IPD_NUMPED).

Try with select * from....

IAMDV
Luminary Alumni
Luminary Alumni

Hi,

Not sure what you mean by adapt in QlikView? Do you want to re-write the same query in QlikView or do you want to use the SQL query in QlikView? Please clarify.

Thanks,

DV

www.QlikShare.com

Not applicable
Author

Hi,

Deepak,  I want to re-write the same query in QlikView. This query returns a message to the User: "Pedido Finalizado" and need to do the same in QlikView

IAMDV
Luminary Alumni
Luminary Alumni

Hi,

Thanks for clarifying! Here we go...

Bad News: There is NO Having clause in QlikView

Good News: We can still solve this by using Where clause and the Preceding Load.

I've made a video tutorial sometime back and hopefully it will answer your question.

http://qlikshare.com/qlikview-video-tutorial-clause-qlikview/

However, you syntax will look something like this...

//This is Preceding Load

LOAD

    *

WHERE IPD_BASE >0;

// This is main Load

LOAD

    IPD_NUMPED,

    SUM(IPD_BASE) AS IPD_BASE

From ITPEDIDOS

WHERE

PD_CDEMP = 1

AND IPD_TPPED = 'V'

FROM TableName

GROUP BY IPD_NUMPED;


I hope this helps!

Cheers,

DV

Not applicable
Author

Thank you for the help! I'll watch the video ...

Not applicable
Author

Thank you Deepak, I got the result I needed!!

IAMDV
Luminary Alumni
Luminary Alumni

I'm glad to know that you got it working. Good luck!

Cheers,

DV

www.QlikShare.com