Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
How can I replace expression below with set analysis?
if(Field1=Field2, 0, Sum(Value))
I tried different variants. For example this one doesn't work as well.
Sum({$<Field1-=Field2>} Value)
Better to use in script like
If(Field1 <> Field2 , 1, 0) as Flag
And set analysis
Sum({<Flag = {'1'}>}Value)
Try
=Sum({<Field1={"=Field1<>Field2"}>}Value)
Hi Max,
Set Analysis is calculated per Chart and You need per Rows.
So
Sum(If(Field1=Field2,0,Value))
However Sintax Set Analysis is like this
Sum({<Field1-={'$(=Max(Field2))'}>} Value)
or like this
Sum({<Field1=E(Field2)>} Value)
Regards,
Antonio
Thanks but all versions of set analysis don't show an expected result.
I can't use flag in script according to current data model.
Please look at the attachment qvw
First chart shows correct result with IF statement.
Other ones with all set analysis variants above. They show different.
In this case the Expression must be evaluated per row, then You need If() instead of Set Analysis.
May be
Sum({<Field2={"=Field1<>Field2"}>}Value)
If its a row to row comparison then I would prefer to have it in the script level .....in the front end it will take lot of time to evaluate and render
Thanks all and especially Andrey.
to avinashelite
I have created matrix where all values in field1 are equals to all values in field2. Let's say field2 is duplicate from field1.
How can I create flag in script in this case?
if you share the sample data set we could help you out..create a separate thread