Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Multiply figures in a pivot - column

Hello All,

Is that possible to multiply key figures in a column and return that in a variable like this sample:

Year     Country     City    populGrowth

2014     USA          NY     0,12

2014     USA          MC     0,045

2014     USA          MI       0,21

2014     CAN          OTW     0,44

2014      CAN          CAL     0,22

and so on.

I try to multiply the figures based on year and country:

2014/USA: 0,12*0,045*0,21

2014/CAN: 0,44*0,22

Thank you for any clue?

Fabian

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

No idea. It works here. See attached example.


talk is cheap, supply exceeds demand

View solution in original post

6 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Perhaps like this:

T1:

LOAD * INLINE [

    Year, Country, City, populGrowth

    2014, USA, NY, 0.12

    2014, USA, MC, 0.045

    2014, USA, MI, 0.21

    2014, CAN, OTW, 0.44

    2014, CAN, CAL, 0.22

];

T2:

LOAD Year & '/' & Country as [Year/Country], Evaluate(concat(populGrowth,'*')) as Factor

Resident T1

Group By Year & '/' & Country;


talk is cheap, supply exceeds demand
Not applicable
Author

Hi Gysbert,

Thank you for help. I would solve this action in pivot-table. Is there any way in Qlikview like function evaluate(concate(attr,'*')) like your script? I did not find it.

Thank you for your help.

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try exp(sum(log(populGrowth)))


talk is cheap, supply exceeds demand
Not applicable
Author

I tried that and the result is the same like this synthax:

aggr(sum(populGrowth),Year,Country)

2014/CAN : 1,00

2014/USA: 45,0

Do you know why?

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

No idea. It works here. See attached example.


talk is cheap, supply exceeds demand
Not applicable
Author

Many thanks for your help. I found the error. I droped whole numeric and time format sets, before I started with scripting. After inserting of that your synthax it works.

Thank you again.

Best regards