Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I have what I think is a really simple question here, but just can quite get it right. I want to use a calculation as part of my set analysis (line 3 below) but know I've got the syntax wrong on line 3
count({<UNIT.STOCKSTATUS={'sold'},
BUYER.B_NO={"*"},
UNIT.M_MILEAGE <= [Avg. Mileage]+15000
>}
UNIT.TOTALSOLD)
I'd be really grateful if anyone could point me in the right direction, thanks
whenever using < or > in your set analysis you have to use advanced search so instead of just being <= you have to do {"<=$(=([Avg. Mileage]+15000))"}
this expression should work
count({<UNIT.STOCKSTATUS={'sold'}, BUYER.B_NO={"*"},UNIT.M_MILEAGE = {"<=$(=([Avg. Mileage]+15000))"}
>}
UNIT.TOTALSOLD)
Set analysis calculates at Table level and not row level. Use If like below
count( {<UNIT.STOCKSTATUS={'sold'},BUYER.B_NO={"*"} >}
If(UNIT.M_MILEAGE <= [Avg. Mileage]+15000,UNIT.TOTALSOLD)
)
Hi, thanks for the suggestions.
[Avg. Mileage] is the name of an expression in the same table which is:
=avg({<UNIT.STOCKSTATUS={'sold'}>} UNIT.M_MILEAGE)
If I replace [Avg. Mileage] with a number I can get this to work
count({<UNIT.STOCKSTATUS={'sold'}, BUYER.B_NO={"*"},UNIT.M_MILEAGE ={"<=$(([Avg. Mileage] +15000))"}>} UNIT.TOTALSOLD)
but when I use [Avg. Mileage] or if I do this it doesn't work.
count({<UNIT.STOCKSTATUS={'sold'}, BUYER.B_NO={"*"},UNIT.M_MILEAGE = {"<=$(=(
avg({<UNIT.STOCKSTATUS={'sold'}>} UNIT.M_MILEAGE)
+15000))"} >} UNIT.TOTALSOLD)
You can't do row level calculations or use name of another expr inside set analysis. You can try using If statement as in my above post
Hi, thanks, unfortunately when I use the expression above I just get 0's
Hello
Try calculating ={"<=$(([Avg. Mileage] +15000))"}>} as a "variable" and then introducing that into the set analysis?
Can you post sample app