Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
snarrp_Rocky
Contributor III
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
VishalWaghole
Specialist II
Specialist II

Hi

Use below if statement while loading data,

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

Thanks and Regards,
Vishal Waghole
snarrp_Rocky
Contributor III
Contributor III
Author

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
VishalWaghole
Specialist II
Specialist II

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
Specialist II
Specialist II

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
Contributor III
Contributor III
Author

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.

PrashantSangle

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.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂