Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Experts,
I have a situation where i return Correct and Error from a script If statement.
In a table i would like to say if Correct and error return correct else error.
so i try like this:
If (wildmatch([String Error],'Correct','Error'),'Correct','Error')
in the below the top roe should be the only error.
Can anyone assist in helping with my measure?
Thank you so much in advance.
Try
=if(count(total <UniquePO> {<[String Error]={'Correct'}>}[String Error])>0,'Correct',if(count([String Error]),'Error'))
OR
= Max( aggr( if(count({<[String Error]={'Correct'}>}[String Error])>0,'Correct','Error'), UniquePO ) )
use below in script
if([String Error]='Correct','Correct',[String Error]) as StringError
and use this field in front end.
Hi Chanty,
Thanks again for trying to help today:
I tried the suggestion and i got the same result with Error and Correct,
We should have in the StringError
Error
Correct
Correct
Do you have any other suggestion? i tried this in so may ways.
Thanks a lot for your time.
Daniel
Try below
if( MaxString(TOTAL <UniquePO> [String Error])='Correct','Correct','Error')
Try below
if( MaxString(TOTAL <UniquePO> [String Error])='Correct','Correct','Error')
HI,
Thank you very much for your time.
I have tried but sorry to say this returns the below:
Hi,
May i ask the meaning of this?
<UniquePO>
does this group the result by the dimension?
Thank you
Daniel
is the field [String Error] a dual value field?
You can also try
=if(count({<[String Error]={'Correct'}>}[String Error])>0,'Correct','Error')
TOTAL <UniquePO> does this group the result by the dimension? Yes
refer below
https://community.qlik.com/t5/QlikView-App-Dev/Keywords-TOTAL-ALL-DISTINCT/m-p/143516
Hi,
Thanks again for this info and help.
The suggestion gives the correct result for the 'Correct' but omits the Error from the table
With expression added
and without
Do you have any idea why the measure would not assign the top row as error and just omit from the table?
Thank you
Daniel
Try
=if(count(total <UniquePO> {<[String Error]={'Correct'}>}[String Error])>0,'Correct',if(count([String Error]),'Error'))
OR
= Max( aggr( if(count({<[String Error]={'Correct'}>}[String Error])>0,'Correct','Error'), UniquePO ) )