Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
Expected O/P?
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
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!!
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".
Hi Barbara,
Why do you mark a question as Correct Answer????
This question don't provide an answer to your issue.
Thanks!
Total # of "dr_nbr" per Plant Code. Thanks.
new to the board, accident.
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;
Thanks, I will try this.