Skip to main content
Announcements
Qlik Community Office Hours - Bring your Ideation questions- May 15th, 11 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
shekhar_analyti
Specialist
Specialist

Conditional Intervals . How to deal , without using if ?

Hi All ,

How to find data for conditional intervals , without using multiple if or hard coding as script level ?

In below data i want to populate values of table 2 , based on the value in Measure field of the table 1 .

Capture4.PNG

Thanks & Regards

Shekar

1 Solution

Accepted Solutions
sunny_talwar

Try this

Vector_Observed_Temp:

CrossTable(Range, Data)

LOAD Vector_Observed,

    [0 - 9],

    [10 - 23],

    [24 -  33],

    [34 - 52],

    [53 - 71],

    [72 - 87],

    [88 - 100]

FROM

[..\..\Downloads\Conditional Intervals.xlsx]

(ooxml, embedded labels, table is Vector_Observed);


Vector_Observed:

LOAD Vector_Observed as Vector,

SubField(Range, '-', 1) as Start,

SubField(Range, '-', 2) as End,

Data

Resident Vector_Observed_Temp;


DROP Table Vector_Observed_Temp;


MainTable:

LOAD Date,

    Vector,

    Measure

FROM

[..\..\Downloads\Conditional Intervals.xlsx]

(ooxml, embedded labels, table is Vector);


Left Join (MainTable)

IntervalMatch(Measure, Vector)

LOAD Start,

End,

Vector

Resident Vector_Observed;


Left Join (MainTable)

LOAD *

Resident Vector_Observed;


DROP Table Vector_Observed;

Capture.PNG

View solution in original post

4 Replies
sunny_talwar

Should be Extended IntervalMatch

felipedl
Partner - Specialist III
Partner - Specialist III

Hi SHekar,

Check the Intervalmatch function: https://help.qlik.com/en-US/qlikview/November2017/Subsystems/Client/Content/Scripting/ScriptPrefixes...

It's exactly what it used for

Felipe.

sunny_talwar

Try this

Vector_Observed_Temp:

CrossTable(Range, Data)

LOAD Vector_Observed,

    [0 - 9],

    [10 - 23],

    [24 -  33],

    [34 - 52],

    [53 - 71],

    [72 - 87],

    [88 - 100]

FROM

[..\..\Downloads\Conditional Intervals.xlsx]

(ooxml, embedded labels, table is Vector_Observed);


Vector_Observed:

LOAD Vector_Observed as Vector,

SubField(Range, '-', 1) as Start,

SubField(Range, '-', 2) as End,

Data

Resident Vector_Observed_Temp;


DROP Table Vector_Observed_Temp;


MainTable:

LOAD Date,

    Vector,

    Measure

FROM

[..\..\Downloads\Conditional Intervals.xlsx]

(ooxml, embedded labels, table is Vector);


Left Join (MainTable)

IntervalMatch(Measure, Vector)

LOAD Start,

End,

Vector

Resident Vector_Observed;


Left Join (MainTable)

LOAD *

Resident Vector_Observed;


DROP Table Vector_Observed;

Capture.PNG

shekhar_analyti
Specialist
Specialist
Author

Thank You Bare Bhai ..