Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to create dimension values?

Hi,

If the table below is my data

pivot_1.png

And this is the pivot representation of the same data:

pivot_2.png

So the question is how can I extend the status dimension such that there will be another dimension value called Rebooked in the top table or a new column in the pivot table for the accountno that has both Booked and Failure (accountno: 3000479 for example) ?

Essentially, the condition is If (status = 'Booked' AND status = 'Failure' ,  status = 'Rebooked').

Sorry if my question is not clear but I'm happy to elaborate on this if you guys have any idea about this case?

Many thanks,

Laleh

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

You probably want to do this in the script. 

Something like:

Data:

Load distinct

accountno

From YourFile

where Status='Booked';

inner join(Data)

Load distinct

acountno

From YourFile

where Status='Failure';

noconcatenate

AllData:

Load

accountno,

'Rebooked' as Status

Resident Data;

Drop table Data;

concatenate(AllData)

Load accountno,

Status

From YourFile;

View solution in original post

9 Replies
YoussefBelloum
Champion
Champion

Attach sample data, we will do it directly with your data

Anonymous
Not applicable
Author

Attached is a sample of my data.

Anonymous
Not applicable
Author

If it has a booked and failure would you want it removed from those categories and only count in the new category of 'Rebooked'?

Anonymous
Not applicable
Author

Ideally we want to keep the current statuses as they are while introducing new status i.e an accountno who has both Failure & Booked will have Rebooked.

Anonymous
Not applicable
Author

You probably want to do this in the script. 

Something like:

Data:

Load distinct

accountno

From YourFile

where Status='Booked';

inner join(Data)

Load distinct

acountno

From YourFile

where Status='Failure';

noconcatenate

AllData:

Load

accountno,

'Rebooked' as Status

Resident Data;

Drop table Data;

concatenate(AllData)

Load accountno,

Status

From YourFile;

Anonymous
Not applicable
Author

Sounds like a good idea! Thank you, I'm going to test it now, will let you know how it goes

Anonymous
Not applicable
Author

well-done & thanks a lot!

vishsaggi
Champion III
Champion III

may be try this too.

Table1:

LOAD *, IF(AccountNo = Peek(AccountNo) AND (Match(Status, 'Booked', 'Failure') OR Match(Status, 'Failure', 'Booked')), 'Reebooked', Status) AS NewStatus;

LOAD accountno as AccountNo,

     status as Status

FROM

[..\Desktop\Data.xlsx]

(ooxml, embedded labels, table is Sheet1);

vishsaggi
Champion III
Champion III

Oops too late.