Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Chanty4u
MVP
MVP

FieldValue

Hi all,

I have a data like below attached Excel  with input and  output required.  i need to get one extr column

16 Replies
sunny_talwar

You can try this:

Table:

LOAD RowNo() as RowNum,

  Date,

    Product,

    Type,

    ProNo.,

    [Prod Ref.]

FROM

[SAMPLE-JEW.xlsx]

(ooxml, embedded labels, table is Original)

Where Len(Trim(Date)) > 0;

Left Join(Table)

LOAD RowNo() as RowNum,

    Trim(Product) as Productname

FROM

[SAMPLE-JEW.xlsx]

(ooxml, embedded labels, table is Original)

Where Len(Trim(Date)) = 0;


Capture.PNG

effinty2112
Master
Master

Hi Suresh,

                         This script:

Data:

LOAD

RecNo() as Row,

*;

LOAD Date,

     Product,

     Type,

     ProNo.,

     [Prod Ref.]

FROM

[SAMPLE-JEW.xlsx]

(ooxml, embedded labels, table is Original);

ReverseData:

LOAD

Row,

Date,

     Product,

     Type,

     ProNo.,

     [Prod Ref.],

     if(IsNum(Date), Peek(Product)) as Productname

  Resident Data Order by Row desc;

 

  Drop Table Data;

 

  Data:

  LOAD

Date,

     Product,

     Type,

     ProNo.,

     [Prod Ref.],

Productname

Resident ReverseData Where IsNum(Date) Order by Row;

drop Table ReverseData;

returns this:

Date Prod Ref. Product ProNo. Type Productname
01/04/2016SA-S/16-17/0001Trading Limited(Ttl)MS/16-17/04/001SalesKK COLOUR
01/04/2016SA-S/16-17/002Trading Limited(Ttl)MS/16-17/04/002SalesKK COLOUR
01/04/2016SSL/16-17/001As India LtdXXX/2016/04/003SalesGG COLOR
01/04/2016SSL/16-17/002As India LtdXXX/2016/04/004SalesGG COLOR
01/04/2016SSL/16-17/003As India LtdXXX/2016/04/005SalesGG COLOR
02/04/2016 Si Limited(Sgsl) SalesGK COLOUR
02/04/2016 Si Limited(Sgsl) SalesKK COLOUR
03/04/2016SA-S/16-17/0003Light LtdMS/16-17/04/003SalesGK COLOUR
15/06/2016C16-17/1GGLtd(GGL)SSP/2016/06/035Salespetrol PD022
15/06/2016CSHYRS/16-17/132ght LtdSSSS/16-17/06/024SalesPP petrol HHHH 16-17

Hope this helps

Cheers

Andrew

sunny_talwar

I think I did not do it right the first time, seems you need this:

Table:

LOAD RowNo() as RowNum,

  Date,

    Product,

    Type,

    ProNo.,

    [Prod Ref.]

FROM

[SAMPLE-JEW.xlsx]

(ooxml, embedded labels, table is Original)

Where Len(Trim(Date)) > 0;

TempTable:

LOAD If(Len(Trim(Date)) = 0, Peek('RowNum'), RangeSum(Peek('RowNum'), 1)) as RowNum,

  Date,

    Trim(Product) as Productname

FROM

[SAMPLE-JEW.xlsx]

(ooxml, embedded labels, table is Original);

Left Join (Table)

LOAD RowNum,

  Productname

Resident TempTable

Where Len(Trim(Date)) = 0;

DROP Table TempTable;


Capture.PNG

Chanty4u
MVP
MVP
Author

Hi stalwar1

thanks for your prompt response .

Sorry for late reply. I hope everything is fine.  But one thing is missing in my original data.

in my data below

having same productname with different values are there  above your code working but  only one value is showing .  i need two productnames with different values

same.PNG

Chanty4u
MVP
MVP
Author

Hi Andy,

Thanks its working fine.  but it is giving  Distinct productname

As my data having  two same productname with different values?

how can i achieve this?

Best

Suresh

sunny_talwar

Where are these different values in your database? Can you share?

Chanty4u
MVP
MVP
Author

chk in my sample data also  chk this

for  yellow field values  are same    so it is taking as  single row only.

now  i want    3productnames as 3rows

sunny_talwar

Brother it is a table box object and table box object only show distinct combinations of all the fields.

Look here in the table viewer

Capture.PNG

Chanty4u
MVP
MVP
Author

Oh my bad thanks Bro.  i never  noticed that.

But if i want to show in front end is there any option?