Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
chaitanyajami
Partner - Creator
Partner - Creator

Set analysis Expression Challenge

Hi all,

I have a challenge like iam calculating count of [Quote Number DMP] when [Quote Number Status]= Approved like below


count({<[Quote Status]={'APPROVED'}>}[Quote Number DMP])


now my requirement is to include another condition where count to be calculated when the field value [Approver job name] equals to [Requester job name], kindly suggest how can i achieve it

1 Solution

Accepted Solutions
sunny_talwar

Or if [Approver job name] = [Requester job name] are coming from the same table in the backend, then create a flag in the script

LOAD [Approver job name],

     [Requester job name],

     If([Approver job name] = [Requester job name], 1, 0) as Flag

     ....

FROM ...

and then this

Count({<[Quote Status] = {'APPROVED'}, Flag = {1}>} [Quote Number DMP])

View solution in original post

11 Replies
rahulpawarb
Specialist III
Specialist III

Hello Chaitanya,

Below is the draft version of expression:

If([Approver job name]=[Requester job name], count({<[Quote Status]={'APPROVED'}>}[Quote Number DMP]))

Could you please share the application with sample data? This will help me to provide you more accurate solution.

Regards!

Rahul

chaitanyajami
Partner - Creator
Partner - Creator
Author

Hi Rahul,

Here is my sample data looks like(i cannot copy app due to security restrictions) , and i tried the above expression somehow it was not working Untitled.png

rahulpawarb
Specialist III
Specialist III

Hello Chaitanya,

As I could see that you have list boxes for Approver Job Name & Requester Job Name fields. Where exactly you are planning to use this expression? If it is inside straight table then what other dimensions are there?

Regards!

Rahul

settu_periasamy
Master III
Master III

Hi,

May be try like this

=count({<[Quote Status]={'APPROVED'},

          KeyField={'=[Approver job name]=[Requester job name]'}>}

    [Quote Number DMP])

chaitanyajami
Partner - Creator
Partner - Creator
Author

Hi Rahul,

basically when 'Approver Job Name' value equal to  'Requester Job Name' value then we are calculating the count of 'Quote Number DMP' (with condition [Quote Status]={'APPROVED'}), we are showing this in a textbox

chaitanyajami
Partner - Creator
Partner - Creator
Author

Hi,

key field is not there , we just need to calculate when 'Approver Job Name' value equal to  'Requester Job Name' value then  count of 'Quote Number DMP' (with condition [Quote Status]={'APPROVED'})

settu_periasamy
Master III
Master III

Have you tried the Rahul's expression?

also check this..

=Count(Aggr(if([Approver job name]=[Requester job name] and [Quote Status]='APPROVED',[Quote Number DMP]),[Approver job name],[Requester job name]))

chaitanyajami
Partner - Creator
Partner - Creator
Author

Hi,

I have tried Rahul's expression it was not working, Ok i will try this Thank you

sunny_talwar

Give this a try as well

Count({<[Quote Status] = {'APPROVED'}>} If([Approver job name] = [Requester job name], [Quote Number DMP]))