Hi, I have created a new metric like this ```SELEC...
# gd-beginners
d
Hi, I have created a new metric like this
Copy code
SELECT CASE WHEN Charging Unit="ONE-OFF" THEN Quantity ELSE 0 END
but I can't use this with any attributes in my LDM. As soon as I added this metric to my analysis, all my attributes filtered out and only facts visible. Anyone can give me some pointers, please? I have two more metrics like this and can't even pick all three together
Copy code
SELECT CASE WHEN Charging Unit="DURATION" THEN Quantity ELSE 0 END
SELECT CASE WHEN Charging Unit="MB" THEN Quantity ELSE 0 END
i
Hi Dilaksha, Please try to put your CASE statement inside the SUM aggregation as in my example below:
Copy code
SELECT SUM(SELECT CASE WHEN Charging Unit="ONE-OFF" THEN Quantity ELSE 0 END)
d
thanks @Ivan Nejezchleb - still did not work LDM abstraction here table A has
Charging Unit
table B has
Quantity
table C joins A and B A --< C --< B I can confirm the data exists for these relationships as well
👀 2
i
@Dilaksha Attanayake I think you wanted to ping @Ivana Gasparekova, not me
👍 1
d
oh apologies both 😞
i
No problem at all, let me think a bit of what else might be causing such behaviour, please.
d
thanks, I can give you the workspace id if that helps I tried using aanalysis to replicate what this metric should return and that works, so LDM and data seems to be okay
Thanks, all - figured that one out. I can't use strings "MB" . I have to use the editor and select this MB value from attribute values - annoying but figured it out
2
i
Yes, unfortunately, this how the Metric Editor for GD Platform was designed. But I am glad that you were able to sort this out.
d
Thanks, once you know it's okay but perhaps one for your roadmap