Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculated Field

Hi

Could anyone help me.

I have a dashboard and want to create a new field.

If the field Expense = "Income" then I want my field to have the value in the field "Category"

If the field Expense = "Direct" then I want my field to have the value in the field "Org_Unit"

If the field Expense = "Indirect" then I want my field to have the value in the field "Exp_Catt"

Thanks for your help.

(This is my first Qlikview dashboard, so I will get better !!)

8 Replies
MK_QSL
MVP
MVP

You can create below in your script

Load

Value,

Expense,

If(Expense = 'Income', Value) as Category,

If(Expense = 'Direct', Value) as Org_Unit,

If(Expense = 'Indirect', Value) as Exp_Catt,

OtherFields....

From Souc

alexandros17
Partner - Champion III
Partner - Champion III

In the script you have something like:

Select (or Load)

...

Expense

...

From

...

Where

...


then transform it into:

Select (or Load)

...

Expense,

If(Expense = 'Income', 'Category',

     If(Expense = 'Direct', 'Org_Unit',

          If(Expense = 'Indirect', 'Exp_Catt', 'Undefined'

          )

     )

) as myNewField

...

From

...

Where

...

Let me know

Not applicable
Author

Try this in chart's expression:

Pick(Match(GoodField, 'Income', 'Direct', 'Indirect'), 'Category', 'Org_Unit', 'Exp_Catt')

where good field is your field, see attached example.

its_anandrjs

Provide any sample file.

Regards

Anand

MarcoWedel

LOAD somefields,

          Pick(Match(Expense, 'Income','Direct','Indirect'), 'Category', 'Org_Unit','Exp_Catt') as [new field]

FROM anywhere;

MarcoWedel

QlikCommunity_Thread_140967_Pic1.JPG.jpg

hope this helps

regards

Marco

MarcoWedel

just noticed my mistake.

Better try:

LOAD somefields,

          Pick(Match(Expense, 'Income','Direct','Indirect'), Category, Org_Unit, Exp_Catt) as [new field]

FROM anywhere;

hope this helps

regards

Marco

MarcoWedel

like this:

QlikCommunity_Thread_140967_Pic2.JPG.jpg

LOAD *,

    Pick(Match(Expense, 'Income','Direct','Indirect'), Category, Org_Unit, Exp_Catt) as [new field];

LOAD RecNo() as ID,

    Pick(Ceil(Rand()*3),'Income','Direct','Indirect') as Expense,

    Ceil(Rand()*100) as Category,

    Ceil(Rand()*100) as  Org_Unit,

    Ceil(Rand()*100) as  Exp_Catt

AutoGenerate 20;

hope this helps ...

...finally

regards

Marco