Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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 !!)
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
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
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.
Provide any sample file.
Regards
Anand
LOAD somefields,
Pick(Match(Expense, 'Income','Direct','Indirect'), 'Category', 'Org_Unit','Exp_Catt') as [new field]
FROM anywhere;
hope this helps
regards
Marco
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
like this:
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