Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

hopkinsc
Valued Contributor II

Where function in script

Hi,I am writing a VAT application and  i am trying to break down a SalesValue field in my script

E.g.

Sales Value =£1000 which is a total of £200 Vat Code A, £400 Vat Code B and £400 Vat Code C

I want to break this down in the script and make new fields something like:

Load...

SalesValue Where VATIndicator ='A' AS SalesValueA,

SalesValue Where VATIndicator ='B' AS SalesValueB,

SalesValue Where VATIndicator ='C' AS SalesValueC

From...

But i do not know how to do it..

I know i can use set analysis in a chart to total up each VAT Code but i thought it might be quicker to get it done in the script instead (As the script is reloaded out of hours)

Can anyone help please?

1 Solution

Accepted Solutions
jedgson
Contributor

Where function in script

Try,

Load

     If( VATIndicator = 'A', SalesValue, 0) as SalesValueA,

     If( VATIndicator = 'B', SalesValue, 0) as SalesValueB,

     If( VATIndicator = 'C', SalesValue, 0) as SalesValueC

From ..

Jay

1 Reply
jedgson
Contributor

Where function in script

Try,

Load

     If( VATIndicator = 'A', SalesValue, 0) as SalesValueA,

     If( VATIndicator = 'B', SalesValue, 0) as SalesValueB,

     If( VATIndicator = 'C', SalesValue, 0) as SalesValueC

From ..

Jay

Community Browser