Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Create calculated dimension in script

Hi guys,

I have some problem with my calculated dimension.

I need put this calculated dimension in script because my pivot table exceeded the memory.

So my calculated dimension is:

=if(aggr((totalCategoriasKpi),id_master)=1 ,Dual('1',1),

     if(aggr((totalCategoriasKpi),id_master)=2 ,Dual('2',2),

     if(aggr((totalCategoriasKpi),id_master)=3 ,Dual('3',3),

     if(aggr((totalCategoriasKpi),id_master)=4 ,Dual('4',4), dual ('5+',5)))))

What kind of transformation i have to do put this calculated dimension in to the script?

Thanks in advance,

Pedro Lopes

3 Replies
sunny_talwar

First of all what kind of aggregation are you doing here? are you doing a Sum? Count? Min? Max?? you have not specified anything here:

=If(Aggr(Sum/Count/Max/Min(totalCategoriasKpi),.....

I think if you add that to your calculated dimension, it should yield a result.

Hope this helps

Best,

Sunny

Anonymous
Not applicable
Author

Sorry, its (Sum , but don't work either =/  'exceeded the memory'

sunny_talwar

If that doesn't help then you can do something like this in the script:

Join (yourFactTable)

LOAD If(SumtotalCategoriesKpi = 1, Dual('1', 1), If(SumtotalCategoriesKpi = 2, Dual('2', 2),           If(SumtotalCategoriesKpi = 3, Dual ('3', 3), If(SumtotalCategoriesKpi = 4, Dual('4', 4), Dual ('5+', 5))))) as Dimension,

          SumtotalCategoriesKpi,

          id_master;

LOAD Sum/Count/Max/Min (totalCategoriasKpi) as SumtotalCategoriesKpi,

          id_master

Resident yourFactTable

Group By id_master;

HTH

Best,

Sunny