Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

EditScript

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

4 Replies
prieper
Master II
Master II

Can you post an example?

Peter

Not applicable
Author

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;



prieper
Master II
Master II

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

Not applicable
Author

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 MeasureKey

MeasureName,

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;