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: 
bjjackson2760
Contributor
Contributor

New to Qlikview - SQL meaning to Qlikview Expression

I have the following that I am trying to get totals per plant, but the field is a string therefore I can count them.  However , I can get what I need in SQL but I can't quite put it into Qlikview words.  Can someone please assist? Thanks in advance! Below is the SQL:

select distinct price_plant_code, count(dr_nbr)

from respermits.dbo.SLSD rs

join ResPermits.dbo.permits rp

on rs.division = rp.division

group by price_plant_code, dr_nbr

15 Replies
Anil_Babu_Samineni

Expected O/P?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Mark_Little
Luminary
Luminary

Hi Barbara,

Could you please supply at little more information and some example data?

Is this total something you want on a front end chart or in script?

Mark

Anonymous
Not applicable

Hi Barbara,

On SQL:

select distinct price_plant_code, count(dr_nbr)

from respermits.dbo.SLSD rs

join ResPermits.dbo.permits rp

on rs.division = rp.division

group by price_plant_code, dr_nbr


On QLikview:

SQLTABLE:

LOAD *;

SQL select distinct price_plant_code, dr_nbr

from respermits.dbo.SLSD rs

join ResPermits.dbo.permits rp

on rs.division = rp.division;


FinalTable:

LOAD

     price_plant_code,

     count(dr_nbr)     as Count_dr_nbr

RESIDENT SQLTABLE

GROUP BY price_plant_code;


Regards!!

bjjackson2760
Contributor
Contributor
Author

Hi Mark,

Thanks for the reply.  Yes, this is something that I would like to be able to do in the expression of the chart.  The Dimension is the "Plant code" and I would like to sum/total up the "dr_nbr".

Anonymous
Not applicable

Hi Barbara,

Why do you mark a question as Correct Answer????

This question don't provide an answer to your issue.

Thanks!

bjjackson2760
Contributor
Contributor
Author

Total # of "dr_nbr" per Plant Code.  Thanks.

bjjackson2760
Contributor
Contributor
Author

new to the board, accident.

Anil_Babu_Samineni

Barbara,

Put like below

Connect to ODBC

SQL select distinct price_plant_code, count(dr_nbr)

from respermits.dbo.SLSD rs

join ResPermits.dbo.permits rp

on rs.division = rp.division

group by price_plant_code, dr_nbr;

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
bjjackson2760
Contributor
Contributor
Author

Thanks, I will try this.