Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

snarrp_Rocky
New Contributor III

Dimension Query

Dear All, Need your help on below query. I have two dimensions in the data, I need to get them in one dimension in qlik view. The output shown below. Your help is great appreciated. Regards

 

Data

Dimension1         Dimension2     Sales

Parent                                                   1000

                                         Child1            230

                                        Child2            234

                                         Child3           450

Qlik view output should be

Dimension Sales

Parent 1000

Child1 230

Child2 234

Child3 450

Note: I do not want to use IF function here since that slows down the calculation speed.

 

7 Replies
Damarlavenkatesh
Contributor

Re: Dimension Query

VishalWaghole
Valued Contributor II

Re: Dimension Query

Hi

Use below if statement while loading data,

If(isNull(Dimensions1), Dimensions2, Dimensions 1) as Dimensions

Thanks and Regards,
Vishal Waghole
snarrp_Rocky
New Contributor III

Re: Dimension Query

Thanks for this Venkatesh. Actually I did not give the clear data structure. Please find below the data and the output I am trying to achieve. Your help is much appreciated.

 

Data  
Dimension1Dimension2Sales
Parent 1000
 Child1230
 Child2240
 Child3320
 Child4457
 Child584
 Child6544
 Child7141

 

Output 
DimensionSales
Parent1000
Child1230
Child2240
Child3320
Child4457
Child584
Child6544
Child7141
Highlighted
VishalWaghole
Valued Contributor II

Re: Dimension Query

Hi

Try this,

Data:
Load Dimension1 as Dimension,
Sales
From YourTable
Where not isNull(Dimension1);

Concatenate (Data)
Load Dimension2 as Dimension,
Sales
From YourTable
Where not isNull(Dimension2);

Thanks and Regards,
Vishal Waghole
VishalWaghole
Valued Contributor II

Re: Dimension Query

If above solution not worked then try this

Data:
Load Dimension1 as Dimension,
Sales
From YourTable
Where len(Dimension1)>0;

Concatenate (Data)
Load Dimension2 as Dimension,
Sales
From YourTable
Where len(Dimension2)>0;

Hope this will work for you.

Thanks,
Vishal
snarrp_Rocky
New Contributor III

Re: Dimension Query

Thanks Vishal. But Can this be done with expression which should not lead to performance issue? Usually IF function is good for this but IF function slows down the performance. I have huge records in the QVD.

Solution with Expression would be very helpful please.

Re: Dimension Query

try alt() also, If your column1 contain null records and you want to replace with column2 then use
alt(column1,column2) as new_column

Regards,
Great dreamer's dreams never fulfilled, they are always transcended.