Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
HI,
i have 3 columns..
By default i need a bar chart ,if u select a key there is some max version for that key..i need the value of that version for all keys.
i have attached a sample for u..plz refer to that !
almost
no bro..the expression which u have sent is for max value...i need the count of oder count(oder) for each key with its max version,,,for eg: for key 20130101 max version is 2 and count of oder is 3...i need dis for all keys... !
bro any output on my post
you're better off manipulating the source table.
I derived the max version for each year and drop rows not related to max year:
data:
load * Inline
[
key, version, value, oder
20130102, 4, 7, oredr4
20110101, 3, 3, order1
20120201, 3, 76, order3
20130102, 3, 1, oredr4
20110101, 2, 11, order1
20120201, 2, 65, oder2
20130101, 2, 5, oder3
20130102, 2, 2, oredr4
20110101, 1, 12, order1
20120201, 1, 34, order1
20130101, 1, 6, oder3
20130102, 1, 4, order3
];
tab:
Join
Load key,
max(version) as MaxVersion
Resident data
Group by key;
data1:
NoConcatenate
load
key,
version,
value,
oder,
MaxVersion
Resident data
Where version = MaxVersion;
drop Table data;
resulting table :
I suppose this app is a KPI thing?
You can not resolve that with a set expression, since you are trying to alter the set row by row.
In your example I think =max(aggr(only(value), key, value)) gives the result you have specified
it gives me the same values for the max version
i need the count(oder) with dimension as key...and for each key there is max version...select max version for 1 key..then see there count of orders
Thank you...lets c it could be done in front end
add Flag to rows:
data1:
NoConcatenate
load
key,
version,
value,
oder,
MaxVersion,
If(version = MaxVersion,1,0) as MaxVersionValues
Resident data
;
so now you dont have to drop the non-related rows. table looks below: