Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
ninnartx
Creator
Creator

Update statement Qlikview

Hi,

I'm trying to figure out how to write an update statement on Qlikview.

Table 1:

Code, Name, SalesArea, SalesValue

100, Amy, Area 1, 56040

101, Brian, Area 1, 78320

102, Carol, Area 2, 450

103, Diane, Area 3, 6590

201, StoreA, (blank), 4500

202, StoreB, (blank), 6010

203, StoreC, (blank), 8000

Table 2:

Code, Name, SalesArea

201, StoreA, Area 1

202, StoreB, Area 2

203, StoreC, Area 3

So what I'm trying to accomplish is, using Table 2 as a reference table, update the SalesArea in Table 1 for the customers that have codes starting with "2". However, I can't just use Table 2 because there is no SalesValue.

Any help would be appreciated!! Thank you!!

1 Solution

Accepted Solutions
sunny_talwar

May be something like this:

Table:

LOAD * INLINE [

    Code, Name, SalesArea, SalesValue

    100, Amy, Area 1, 56040

    101, Brian, Area 1, 78320

    102, Carol, Area 2, 450

    103, Diane, Area 3, 6590

    201, StoreA, , 4500

    202, StoreB, , 6010

    203, StoreC, , 8000

];

Left Join (Table)

LOAD * Inline [

Code, Name, SalesArea1

201, StoreA, Area 1

202, StoreB, Area 2

203, StoreC, Area 3

];

FinalTable:

LOAD Code,

  Name,

  If(Len(Trim(SalesArea)) = 0, SalesArea1, SalesArea) as SalesArea,

  SalesValue

Resident Table;

DROP Table Table;

View solution in original post

2 Replies
sunny_talwar

May be something like this:

Table:

LOAD * INLINE [

    Code, Name, SalesArea, SalesValue

    100, Amy, Area 1, 56040

    101, Brian, Area 1, 78320

    102, Carol, Area 2, 450

    103, Diane, Area 3, 6590

    201, StoreA, , 4500

    202, StoreB, , 6010

    203, StoreC, , 8000

];

Left Join (Table)

LOAD * Inline [

Code, Name, SalesArea1

201, StoreA, Area 1

202, StoreB, Area 2

203, StoreC, Area 3

];

FinalTable:

LOAD Code,

  Name,

  If(Len(Trim(SalesArea)) = 0, SalesArea1, SalesArea) as SalesArea,

  SalesValue

Resident Table;

DROP Table Table;

ninnartx
Creator
Creator
Author

Thank you so much !!