Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Not applicable

Create New Dimension of Available ِData

hello dears

i want create Dimension  of Available ِData

i want Create New Dimension That Have 2 Record ,Item1 and Item 2

Item 1 Filter Data Between 01/01/2014 to 06/01/2014

And Item 2 Filter Data Between 07/01/2014 to 07/05/2014

plz help me

Pic.png

1 Solution

Accepted Solutions

Re: Create New Dimension of Available ِData

Best way is to create that field in the script:

LET Start = num(makedate(2014,1,1));

LET End = num(makedate(2014,5,30));

LET NumOfDays = End - Start + 1;

k_tmp:

load

  $(Start) + Rowno()-1 as dateTMP

AutoGenerate $(NumOfDays);

k:

LOAD *,

  if(Activation_date >= makedate(2014,1,1) and  Activation_date <= makedate(2014,1,6), 'Item1',

  if(Activation_date >= makedate(2014,1,7) and  Activation_date <= makedate(2014,5,7), 'Item2')) as Item;

load

  Date(dateTMP) as Activation_date,

    Year(dateTMP) as Year,

    Month(dateTMP) as Month,

    Day(dateTMP) as Day,

    WeekDay(dateTMP) as WeekName,

    Week(dateTMP) as Week,

    Month (dateTMP) &'-'&Year (dateTMP) as MMYYYY

Resident k_tmp;

DROP Table k_tmp;

If you don't like that then you can try an expression for the listbox:

=if(Activation_date >= makedate(2014,1,1) and  Activation_date <= makedate(2014,1,6), 'Item1',

  if(Activation_date >= makedate(2014,1,7) and  Activation_date <= makedate(2014,5,7), 'Item2'))


talk is cheap, supply exceeds demand
3 Replies

Re: Create New Dimension of Available ِData

Best way is to create that field in the script:

LET Start = num(makedate(2014,1,1));

LET End = num(makedate(2014,5,30));

LET NumOfDays = End - Start + 1;

k_tmp:

load

  $(Start) + Rowno()-1 as dateTMP

AutoGenerate $(NumOfDays);

k:

LOAD *,

  if(Activation_date >= makedate(2014,1,1) and  Activation_date <= makedate(2014,1,6), 'Item1',

  if(Activation_date >= makedate(2014,1,7) and  Activation_date <= makedate(2014,5,7), 'Item2')) as Item;

load

  Date(dateTMP) as Activation_date,

    Year(dateTMP) as Year,

    Month(dateTMP) as Month,

    Day(dateTMP) as Day,

    WeekDay(dateTMP) as WeekName,

    Week(dateTMP) as Week,

    Month (dateTMP) &'-'&Year (dateTMP) as MMYYYY

Resident k_tmp;

DROP Table k_tmp;

If you don't like that then you can try an expression for the listbox:

=if(Activation_date >= makedate(2014,1,1) and  Activation_date <= makedate(2014,1,6), 'Item1',

  if(Activation_date >= makedate(2014,1,7) and  Activation_date <= makedate(2014,5,7), 'Item2'))


talk is cheap, supply exceeds demand
Not applicable

Re: Create New Dimension of Available ِData

Thanks This is Correct

Do you Can Implement Without change edit Script ,

Implement In ListBox Expression ,I am not allowed change edit script

Re: Create New Dimension of Available ِData

Hi,

Create List box with expression and write if statement as suggested by Gysbert.

Regards

Regards,
Prashant Sangle
Community Browser