Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi,
in my database having 2 tables and contains field in first table is "measurename" , the second table having a field "value".
In Qlikview EditScript i used JOINS for this 2 tables.
Now my need is how can i write "Case' Statement for getting particular measurename's value in straightTable.
Thnks
Can you post an example?
Peter
can you check is this query is correct or not.
case when b.measurename like '%depth%' then a.Value else 0 end as depth,
FROM AliNewDB.dbo."FACT_AttributeMeasure" as a inner join
AliNewDB.dbo."DIM_LensAttributeMeasure" as b on a.SkeyMeasureID=b.SkeyMeasureID;
Same you should be able to achieve with IF:
LOAD ...., IF(WILDMATCH(b.measurename, '*depth*'), a.Value, 0) AS Depth;
SQL SELECT * FROM .....
HTH
Peter
hi thnks for ur immediate response, when i am trying it what you send it is showing an error like this . And check once below to the ERROR MESSAGE which is in EDITSCRIPT.
By checking this can you send where i need to modify .
/******ERROR MESSAGE**********/
Field not found - <b.MeasureName>
SQL SELECT b.MeasureName,
a.SkeyInspectionID as inspid,
SkeyLensAttributeID,
a.Value as MeasureValue,
a.LensPosX,
a.LensPosy
FROM AliNewDB.dbo."FACT_AttributeMeasure" as a inner join
AliNewDB.dbo."DIM_LensAttributeMeasure" as b on a.SkeyMeasureID=b.SkeyMeasureID
/*********PRESENTED IN EDITSCRIPT*************/
Measure:
Left
Keep(Inspection)
LOAD
RowNo() as MeasureKeyMeasureName,
MeasureValue,
LensPosX,
LensPosy,
Hash128(inspid, SkeyLensAttributeID) as insp_defect,
IF(WILDMATCH(b.MeasureName, '*depth*'), a.Value, 0) AS Depth;
SQL SELECT b.MeasureName,
a.SkeyInspectionID as inspid,
SkeyLensAttributeID,
a.Value as MeasureValue,
a.LensPosX,
a.LensPosy
FROM AliNewDB.dbo."FACT_AttributeMeasure" as a inner join
AliNewDB.dbo."DIM_LensAttributeMeasure" as b on a.SkeyMeasureID=b.SkeyMeasureID;