Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
renjithpl
Specialist
Specialist

Split same table into two

Hi all,

I have attached an excel sheet. There i need to split same table into two.

I want to assign a field name as 'Phase1' From DateCoded (12-Nov - 15-Nov)

and 'Phase2' from DateCoded (16-Nov - 17-Nov)

So in my application i should able to select a field called Phase, there i should able to selecet Phase1 and Phase2

Thanks in advance.

4 Replies
brenner_martina
Partner - Specialist II
Partner - Specialist II

Hi, Ranjit

you must not split your table, better you enter a new field like this:

If(DateCoded>Firstdate And DateCoded<Lastdate,'Phase 1','Phase2') As Phase

Firstdate can be a variable or a Datefield or an expression

marcel_olmo
Partner Ambassador
Partner Ambassador

Hey Ranjit, I don't understand why you want to split that table.

If I were you I would do something like this (just the idea) :

Table1:

load * from bool1.xlsx;

ResidentTable1:

load

DateCoded,

DateCoded as Phase,

if(DateCoded 12 - 15 nov, DateCoded) as Phase1,

if(DateCoded 16- 17 nov, DateCoded) as Phase2

resident Table1;

Hope it helps!!

renjithpl
Specialist
Specialist
Author

HI Martina thanks for your reply,

It worked fine,

I framed it like below

If([Date Coded]>= 40494 And [Date Coded]< 40501,'Phase 1','Phase 2') As Phase,

Is there a way where in instead putting 40494, can i put 12-nov or 11/12/2010. When i tried 11/12/2010 it dint work, because the system needs to understand the format.

Please suggest. But your answer worked perfect.

johnw
Champion III
Champion III


Ranjit wrote:Is there a way where in instead putting 40494, can i put 12-nov or 11/12/2010. When i tried 11/12/2010 it dint work, because the system needs to understand the format.


Here are a couple ways:

makedate(2010,11,12)
date#('11/12/2010','MM/DD/YYYY')