Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
paulyeo11
Master
Master

Expression convert to Load script become not working ?

Hi All

I have a load script which i mark // which is not working.

sales:
LOAD
'PMC' as SOURCE,
[Row Total],
[Price Currency],
[Price Currency] as CURRENCY,
// Sum([Row Total] * Pick(Match([Price Currency], 'EUR', 'NT', 'USD', 'YEN', 'BAH', 'SGD'), 1.64, (1/24), 1.25, 0.012, 1/24, 1)) as sales,
Quantity AS [quantity],
[Manufacturer Name (Brand)] AS BRAND_RAW,
[Manufacturer Name (Brand)] AS BRAND_,
Date( Date#([Posting Date], 'DD.MM.YY'), 'DD/YY/YYY') as [date],
[Product Code] AS PRO_CLASS

FROM
[C:\Users\Paul Yeo\Dropbox\QLIK_SAP\DEVELOPMENT_QV\ask\TDS.xlsx]
(ooxml, embedded labels, table is TDS);


When i apply below expression at Table 1 it work fine :-
Sum([Row Total] * Pick(Match([Price Currency], 'EUR', 'NT', 'USD', 'YEN', 'BAH', 'SGD'), 1.64, (1/24), 1.25, 0.012, 1/24, 1))

Hope some one can share with me where go wrong ?

Paul Yeo

1 Solution

Accepted Solutions
Vegar
MVP
MVP

Sum() is an aggregatet function and you will need to point out over which dimensions you want to do the aggregation with a GROUP  BY .

 

I suspect that you don't need the sum. Try this instead:

[Row Total] * Pick(Match([Price Currency], 'EUR', 'NT', 'USD', 'YEN', 'BAH', 'SGD'), 1.64, (1/24), 1.25, 0.012, 1/24, 1) as Sales,

View solution in original post

4 Replies
paulyeo11
Master
Master
Author

Hi All Enclosed my QVW for your ref.

Vegar
MVP
MVP

Sum() is an aggregatet function and you will need to point out over which dimensions you want to do the aggregation with a GROUP  BY .

 

I suspect that you don't need the sum. Try this instead:

[Row Total] * Pick(Match([Price Currency], 'EUR', 'NT', 'USD', 'YEN', 'BAH', 'SGD'), 1.64, (1/24), 1.25, 0.012, 1/24, 1) as Sales,

paulyeo11
Master
Master
Author

Hi Sir

thsnk you very much it work now

Vegar
MVP
MVP

Thats sounds great.

Glad to help.