Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have this flat table in my app in Qliksense:
Products | Price | Cost |
---|---|---|
A | 5 | 6 |
B | 7 | 5 |
C | 4 | 2 |
D | 8 | 10 |
What I want is to have a single expression that can sum the larger of Cost or Price for all Products (essentially summing all the bold cell).
I was thinking of creating like a dummy table using aggr that produce something like this:
Products | max(Price,Cost) |
---|---|
A | 6 |
B | 7 |
C | 4 |
D | 10 |
and just simply sum the Max(Price,Cost) field. But I haven't really come up with anything yet.
Please let me know if this is the right way or there is a better approach. Thanks!
Try This
RangeMax(Price,Cost)
Thanks! I managed to use that in my data load editor as:
LOAD
...
RangeMax(Price,Cost) as MaxPC
...
And I just need to sum the MaxPC field as usual within the app. It works perfectly this way.