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

Announcements
Streamlining user types in Qlik Cloud capacity-based subscriptions: Read the Details
cancel
Showing results for 
Search instead for 
Did you mean: 
dushyant
Contributor III
Contributor III

OrderSalesAmount%

Hello, I'm unable to create OrderSalesAmount% . It is showing me an error 'Invalid Expression'. Please assist.

 

[Order Details]:

LOAD Round(LineSalesAmount-COGS,'0.01') AS Margin, * ;

LOAD

OrderID,

OrderLineKey,

ProductID,

Quantity,

UnitPrice,

Discount,

Round(LineSalesAmount,'0.01') AS LineSalesAmount,

ApplyMap('Products_Map',ProductID,'EMPTY')*Quantity AS COGS

FROM [lib://Stages/Stage2/Stage2_Order Details.qvd] (qvd);

 

OrderMetrics:

Load

OrderID,

SUM(LineSalesAmount) AS OrderSalesAmount,

(LineSalesAmount/SUM(LineSalesAmount)*100) AS OrdersalesAmount%

Resident Fact_table Group By OrderID ;

Labels (3)
1 Reply
Lisa_P
Employee
Employee

Your aggregation table does not make sense to create OrderSalesAmount%.

When you aggregate/group by OrderID then you are no longer looking at the LineSalesAmount at the Line level, so this has no place in this table, this can be calculated in the front end.