Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi tell me please how to compare Sum (##) by year in the same table, thank you in advance
remove year as dimension, you can get the values as
sum({<yearfield={2018}>}somefield),
sum({<yearfield={2017}>}somefield)
if you want to keep year as dimension and of expression as some other year
sum(Total<A,B,C>{<yearfield={2017}>}somefield) where A,b,C are all fields in dimension list other than year
I'm sorry, that's not how I phrased the question.
Result: 2018 A 20
How can I compare values from the same table (2017 B 15 > 2018 B 3 -- yes, since 15 > 3, so we don't include it in the result set). For example, left join, but use set analysis
i @Vittore8,
Have you already found this thread Comparing values in the same table?
Would this solution be what you are looking for?
Hi @Vittore8 are you still facing the same problem?
Please let us from Community know, so we can help you.
One solution is.
tab1:
LOAD * INLINE [
Yr, ID, Value
2017, A, 10
2017, B, 15
2018, A, 20
2018, B, 3
];
tab2:
LOAD ID, Yr As Yr1, Value as V1
Resident tab1
Where Yr=2017;
Left Join(tab2)
LOAD ID, Yr As Yr2, Value as V2
Resident tab1
Where Yr=2018;
tab3:
NoConcatenate
LOAD *, If(V1>V2, 'Yes', 'No') As Result
Resident tab2;
Drop Table tab1, tab2;
Output