Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

rido1421
Contributor III

Creating a dimension from 4 different field names

Hi There

I have 4 fields

Each field has Numerical values  in them.

I would like to create one field from the 4 and call it Age_Group.

so that I could use this as the Dimension in a Pie chart.

      QUANTITY_3_MONTHS,
     QUANTITY_3_TO_6_MONTHS,
     QUANTITY_6_TO_12_MONTHS,
     QUANTITY_12_MONTHS_PLUS

What is the simplest way to do this?

Your assistance is appreciated.

Thanks.

1 Solution

Accepted Solutions
MVP & Luminary
MVP & Luminary

Re: Creating a dimension from 4 different field names

Probably a CrossTable load:

CrossTable(Age_Group,Value)

LOAD

    SomeKeyField,

     QUANTITY_3_MONTHS,

     QUANTITY_3_TO_6_MONTHS,

     QUANTITY_6_TO_12_MONTHS,

     QUANTITY_12_MONTHS_PLUS

FROM ....

;


talk is cheap, supply exceeds demand
3 Replies
MVP & Luminary
MVP & Luminary

Re: Creating a dimension from 4 different field names

Probably a CrossTable load:

CrossTable(Age_Group,Value)

LOAD

    SomeKeyField,

     QUANTITY_3_MONTHS,

     QUANTITY_3_TO_6_MONTHS,

     QUANTITY_6_TO_12_MONTHS,

     QUANTITY_12_MONTHS_PLUS

FROM ....

;


talk is cheap, supply exceeds demand
rido1421
Contributor III

Re: Creating a dimension from 4 different field names

Hi Gysbert

This is how I did it... do you think I could run into any problems doing it this way?

I have validated the the values they seem good.

I will try the crosstable in a bit its clearly much simpler.

Load



    
TONS_3_MONTHS as Ton_Value,

     'TONS_3_MONTHS'
as AgeGroup,

    
AgeItemKey

    
Resident Daily_Stock_On_Hand;



Concatenate    

Load    

     
TONS_3_TO_6_MONTHS as Ton_Value,

     'TONS_3_TO_6_MONTHS'
as AgeGroup,

    
AgeItemKey

    
Resident Daily_Stock_On_Hand;



Concatenate    

Load



      
TONS_6_TO_12_MONTHS as Ton_Value,  

        'TONS_6_TO_12_MONTHS'  
as AgeGroup,

      
AgeItemKey

        
Resident Daily_Stock_On_Hand;

        

Concatenate        

Load



       
TONS_12_MONTHS_PLUS as Ton_Value,  

        'TONS_12_MONTHS_PLUS'  
as AgeGroup,

       
AgeItemKey

        
Resident Daily_Stock_On_Hand;

MVP & Luminary
MVP & Luminary

Re: Creating a dimension from 4 different field names

No, that's a perfectly valid way to do it as well.


talk is cheap, supply exceeds demand
Community Browser