Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi to All!!!
i have one sql statement but it doesnt work on Qlikview, but it does in SQL:
Transac:
LOAD
IdentifEspacio,
HoraInicio_EC,
HoraFin_EC,
PautaId,
AnoMes,
HoraInicio_OC,
HoraFin_OC,
CantSalidas,
DuracionTot,
VigDesde_CV,
VigHasta_CV,
Frecuencia_CV,
Horario,
Version
;
SQL SELECT EspacioCont.IdentifEspacio, EspacioCont.HoraInicio as HoraInicio_EC, EspacioCont.HoraFin as HoraFin_EC,
OrdenadoCab.PautaId, OrdenadoCab.AnoMes, OrdenadoCab.HoraInicio as HoraInicio_OC, OrdenadoCab.HoraFin as HoraFin_OC, OrdenadoCab.CantSalidas, OrdenadoCab.DuracionTot,
CostoVersion.VigDesde as VigDesde_CV, CostoVersion.VigHasta as VigHasta_CV, CostoVersion.Frecuencia as Frecuencia_CV, CostoVersion.Horario, CostoVersion.Version
FROM
Publicidad.dbo.EspacioCont ,
Publicidad.dbo.OrdenadoCab ,
Publicidad.dbo.CostoVersion
where
EspacioCont.IdentifEspacio = 'AMER-INTR-PROG' and
OrdenadoCab.IdentifEspacio = EspacioCont.IdentifEspacio and
CostoVersion.IdentifEspacio = OrdenadoCab.IdentifEspacio and
CostoVersion.Version = (select max(CostoVersion.version)
from Publicidad.dbo.CostoVersion
where CostoVersion.IdentifEspacio = EspacioCont.IdentifEspacio
group by CostoVersion.IdentifEspacio)
order by
EspacioCont.IdentifEspacio;
Why doesnt return me any row??? In Sql the query HAVE 28 rows...
Any Idea?
Thanks to all!
When i uncomment the LOAD part... it works with no errors, but doesnt returns me any row...
But only the SQL statement returns me ODBC Error...
Thanks anyway Michael
I see... It is a known bug - script doesn't return error and loads nothing, although there is an error. At least you found out that the error is on the SQL SELECT level.
If this SELECT works outside of QV, the problem most likely with ODBC. I hope you'll be able to resolve it by using OLEDB. Or fix the query if needed.
Regards,
Michael
Hi German,
I think the group by clause could be a problem. I would omit it because it could lead into a return of multiple rows which then could fail the condition CostoVersion.Version = max(CostoVersion.version):
CostoVersion.Version = (select max(CostoVersion.version)
from Publicidad.dbo.CostoVersion
where CostoVersion.IdentifEspacio = EspacioCont.IdentifEspacio
group by CostoVersion.IdentifEspacio)
- Ralf
Makes sense, "group by" is not needed here.
My understanding was that the query worked in SQL. But it is data-sensitive, hence not reliable.
Maybe different handling with ODBC then in database itself..
Exactly what I think
But... it works well in SQL... why doesnt in Qlikview????
Nop... i had try with OLEDB and doesnt work either....
Because, as Ralf Becher said, "different handling with ODBC then in database itself".
Try OLEDB connection.
Can you post sample data from three table and sample qvw