Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Condition in back ground scripting


Hi.  Below is an extract of my scripting.

Its basically bringing  Sales quantity, Sales Value, Cost of Sales per Item per per Customer per Month.

LOAD

[Sales Qty],
[INCOME],
[COS],

[Financial Year],
[Calendar Month],
[Item Code],
[Customer Code]

FROM

[\\ELL-QVW-001\Qlikview\Qlikview Models\QVD\Pol - ELLDAT\Transactions.qvd]
(
qvd)

In our data source, there were certain values which was incorrectly process and therefore i want to correct this in the scripting.

For eg, say,  Item Code, ABC,  in Calendar month, Jan 2014 , Customer , 'John Smith',  the Cost of Sales (COS) was incorrectly processed by an extra $40 000.  How do i create a script that decrease the Cost of Sales by $40 000 for this item for that month.

Is this correct?   If ([item Code]='ABC' and Calendar Month='Jan 2014' and Customer Code='John Smith', [COS]= -40000)

or do i use a 'where statement' at the end?

Thanks

kind regards

Nayan


,

14 Replies
Not applicable
Author

Hi

I get the following error reloading. Which says 'Field Names must be unique within Tables'.

See image attached.

kind regards

NayanError Reloading.JPG

tresesco
MVP
MVP

Comment out the first [COST] field.

Not applicable
Author

Hi Tresesco

Thank you for the prompt response.  Will try and let you know.

kind regards

Nayan

jagan
Luminary Alumni
Luminary Alumni

Hi,

Field names must be unique in the load statement, you have two [COST] fields, so rename any one.

Regards,

jagan.

Not applicable
Author

Hi All

Thank you , the formula worked.

kind regards

Nayan