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

Select only the order ID and add to another

Hi I have a Salesline table like this:

2016-06-01_12h54_25_2.png

And i want to just only add the salesId and date to the Sales table:

2016-06-01_12h54_25.png

any help? many many thank's

1 Solution

Accepted Solutions
sunny_talwar

Apologize, I forgot to add the Group By statement:

Scrap_Salestable:

LOAD

SalesBOid,

FirstSortedValue(Date_Scrap,-ItemId) as Date2,

Only(Date_Scrap) as Date1

Resident Scrap_pre

Group By SalesBOid;

View solution in original post

10 Replies
swuehl
MVP
MVP

It's hard to help here without knowing how your data model looks like, i.e. how the fields you are using in these tables are related, and how the expressions look like.

Could you detail the context of your two charts?

Or could you even upload a small sample QVW?

ecabanas
Creator II
Creator II
Author

Hi,

Unfortunately I could not upload a example due the info is strictly confidential, but i'm going to explain better.

I have a table with this:

Salesline:

  

Sales_IdItemIdDate
A131/01/2016
A231/01/2016
A331/01/2016
A431/01/2016
B128/02/2016

I want to create a table with this date like this:

   Salestable:

Sales_IdDate
A31/01/2016
B28/02/2016

I just want to have a table with a unique SalesID and Date

Maaaaaaany thank's in advance

swuehl
MVP
MVP

Maybe just use Sales_Id as dimension and as expression

=Only(Date)

or create a table box with your two fields

Sales_ID and Date

sunny_talwar

Add Sales_Id as your dimension

and FirstSortedValue(Date, -ItemId) as your expression

or Only(Date) as your expression

ecabanas
Creator II
Creator II
Author

Sorry guys, I miss some info, I wanna create this salestable in load script, because i'll use this table in another process

Thank's

sunny_talwar

May be this:

LOAD Sales_Id,

          FirstSortedValue(Date, -ItemId) as Date2,

          Only(Date) as Date1

Resident Table;

ecabanas
Creator II
Creator II
Author

Hi Sunny,

First of all thank's again 😉

Relating the scrip, it returns to me an error:

Invalid expression

Scrap_Salestable:

LOAD

SalesBOid,

FirstSortedValue(Date_Scrap,-ItemId) as Date2,

Only(Date_Scrap) as Date1

Resident Scrap_pre

Regards

sunny_talwar

Apologize, I forgot to add the Group By statement:

Scrap_Salestable:

LOAD

SalesBOid,

FirstSortedValue(Date_Scrap,-ItemId) as Date2,

Only(Date_Scrap) as Date1

Resident Scrap_pre

Group By SalesBOid;

Anonymous
Not applicable

Try this

Data:
Load Sales_Id, ItemId, Date#(Date,'DD/MM/YYYY') as Date Inline [
Sales_Id, ItemId, Date
A, 1, 31/01/2016
A, 2, 31/01/2016
A, 3, 31/01/2016
A, 4, 31/01/2016
B, 1, 28/02/2016
]
;


TableName:
LOAD Sales_Id,Date,Count(1) as CountNo
Resident Data
Group By Sales_Id,Date;

Drop Field CountNo;