Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

If statement in Load

Hi,

I'm trying to get this line to work in a load statement for a new table.

PerformanceData:

  Load

  [TestId],

  IF ([Site Type] ='ICMP', ([Mean Frame Loss]*2) AS [Mean Packet Loss], [Mean Frame Loss] AS [Mean Packet Loss])

  Resident [TestData]


The fields are in two tables:

    Site:

    Load

    [TestId]

    [Site Type],

    FROM [Combo.qvd] (QVD)

    ;

  TestData:

  Load

  [TestId],

  [Mean Frame Loss],

  FROM [Combo.qvd] (QVD)

    ;

So if the Site Type is ICMP, then the Mean Frame Loss should be doubled and put into the Mean Packet Loss Field, otherwise the Mean Frame loss should be put into the Mean packet loss field unchanged.

1 Solution

Accepted Solutions
sunny_talwar

May be like this:

MappingTable:

Mapping

LOAD [TestId]

    [Site Type]

Resident Site;

PerformanceData:

LOAD [TestId],

  If(ApplyMap('MappingTable', [TestId]) = 'ICMP', ([Mean Frame Loss]*2), [Mean Frame Loss]) as [Mean Packet Loss])

Resident [TestData];

View solution in original post

4 Replies
sunny_talwar

May be like this:

MappingTable:

Mapping

LOAD [TestId]

    [Site Type]

Resident Site;

PerformanceData:

LOAD [TestId],

  If(ApplyMap('MappingTable', [TestId]) = 'ICMP', ([Mean Frame Loss]*2), [Mean Frame Loss]) as [Mean Packet Loss])

Resident [TestData];

Gysbert_Wassenaar

You'll have to join the tables first if you want to do a calculation using fields from both tables. You join the tables and then calculate the result in the new joined table.


talk is cheap, supply exceeds demand
Not applicable
Author

Thanks again, worked a treat.

Not applicable
Author

Thanks, Sunny's solution worked without me having to do a table join so I didn't try this.