Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I'm currently working on a report which uses a lot of IF statements. I prefer to change these expressions using IF into expressions using set analysis. But I'm running into some issues.. Hopefully someone can help me out.
Old situation:
sum ( {<Jaar, Maandnr = >} if( Jaar =GetFieldSelections(Jaar)
and Maandnr =GetFieldSelections(Maandnr)
and Orders.Order_Type='Verkoop'
and DIM_Budget_Item.Budget_Item_Omschrijving='schoenen'
and Orders.Bedrag_Exclusief<>0,
Orders.Aantal_Artikelen))
New Situation:
Rewriting the old expression I ended up with the following expression. This expression gave the same outcome as the 'old situation', but I still had to use an IF statement..
sum(
{$< DIM_Budget_Item.Budget_Item_Omschrijving={'schoenen'},
Orders.Order_Type={'verkoop'}
>}
if ( Orders.Bedrag_Exclusief <>0,
Orders.Aantal_Artikelen))
What does not work..
Trying to leave out all the IF statements I ended up with the following expression, unfortunately this expression does nu give the same result as the two former expressions.
sum(
{$ < DIM_Budget_Item.Budget_Item_Omschrijving={'schoenen'},
Orders.Order_Type={'verkoop'}, Orders.Bedrag_Exclusief -= {0}
>} Orders.Aantal_Artikelen)
So for now I'm stuck with the 'new situation'.
It looks fine. Where are you using this expression? In a chart ? If so, what are the dimensions? Could you post a sample of your qvw?
maybe this
sum(
{$ < DIM_Budget_Item.Budget_Item_Omschrijving={'schoenen'},
Orders.Order_Type={'verkoop'}, Orders.Bedrag_Exclusief -= {'0'}
>} Orders.Aantal_Artikelen)
or post a sample app
I'm using this expression in a pivot table. What do you mean with posting a sample?
Unfortunately this does not work. The expression still returns a different value.
Attach a small sample qvw. Click on 'use advanced editor' (top right corner) ->Attach (bottom right)
please try
{$ < [DIM_Budget_Item.Budget_Item_Omschrijving]={'schoenen'},
[Orders.Order_Type]={'verkoop'}, [Orders.Bedrag_Exclusief] = {"*"}-{0}
>} [Orders.Aantal_Artikelen])
this expression does not work, it results in --> -
Hi,
what columns do you use in the pivot table? (dimensions and metrics)
Your set analysis is correct, so there must be something else that is causing the problem..
seems strange that your "New situation" works, but not your latest complete set
/Pierre
The "doesn't work" and "returns a different value" is not exactly the same... You'd better attach an example as tresesco sais.