Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
1)Total Members : 100
Expression Used : = (SUM(IF(FLAG_MEM_PERSON_KEY=1 , FLAG_MEM_PERSON_KEY)))
2)Total Members who lost weight :
=(SUM(IF(FLAG_MEM_PERSON_KEY=1 and $(WeighLoss) < 0 , FLAG_MEM_PERSON_KEY)))
So WeighLoss is a variable that has weightloss value for each Userid.
Problem:
Hi,
Have a look at the attached application
Regards,
Kaushik Solanki
Hi,
Try this.
=sum(aggr(SUM(IF(FLAG_MEM_PERSON_KEY=1 and ($(WeighLoss))< 0 , FLAG_MEM_PERSON_KEY)),USER_ID))
Regards,
Kaushik Solanki
Lots of issues here:
1) Use set analysis instead of SUM(IF.... Sorry to be blunt but if you dont know set analysis then you need to stop and learn it.
2) The problem is you are summing a key field instead of counting them, or have a dedicated field that holds a 1 per person record that can then be used in SUMs.
Your expressions should be
COUNT({$<FLAG_MEM_PERSON_KEY={'1'}>} FLAG_MEM_PERSON_KEY)
COUNT({$<FLAG_MEM_PERSON_KEY={'1'}, WEIGHT_LOSS={"<0"}>} FLAG_MEM_PERSON_KEY)
on the assumption that weight loss is a field.
Hi,
replacing the variable in the expression I found the following error: "nested aggregation not allowed"
Hi
I have taken a quick look, but do not entirely understand how you are calculating the weight loss variable.
However, you may want to check the spelling of your variable shown in green above, which misses the 't' in weight. I don't think it will sort out your problem though
Its not working
HI,
What output you are expecting. I am getting 0.
Regards,
Kaushik Solanki
Yea me too,
Because UserID 17 has lost weight(-3).
So here count should be 1.
I agree with David. A small investment in time understanding Set Analysis now using this fairly simple example would be well spent, and help greatly in the future.
best regards
Hi,
Have a look at the attached application
Regards,
Kaushik Solanki