-
Re: Show customized value in filter pane
omar bensalem Oct 24, 2017 6:07 AM (in response to siddharth soam)stalwar1, do you have an idea on how to do this?
when we do as an expression:
= rangesum(above(count(Quarters),1,RowNo()))
we'll have the number of all above quarters of the current quarter;
to see all these quarters, I tried this:
=Concat(aggr(Only({$<Quarters = p({1<Quarters={$(=rangesum(above(count(Quarters),1,RowNo())))}>})>} Quarters ),Quarters),',')
Can you see what I'm doing wrong? And is there another way to do it?
Maybe within the script?
-
Re: Show customized value in filter pane
Matteo Pietrucci Oct 24, 2017 6:25 AM (in response to omar bensalem )Hi,
in the filter panel i'm not sure that you can use Concat function; for resolve this case, i think that you must use script like this (for example):
MAP_QUARTER:
MAPPING LOAD * INLINE [
QUARTER , PREVIOUS
Q2 , Q1
Q3 , "Q2,Q1"
Q4 , "Q3,Q2,Q1"
];
NoConcatenate
QUARTER:
Load
QUARTER AS CURRENT,
ApplyMap('MAP_QUARTER',QUARTER,'#ND#') AS PREVIOUS
Resident QUARTER_TMP;
DROP TABLE QUARTER_TMP;
In the fillters, you must write this aggregation:
1) =aggr(Only({1<CURRENT-={'Q1'}>}CURRENT),CURRENT)
2) =aggr(Only({1<CURRENT-={'Q1'}>}PREVIOUS),PREVIOUS)The final result is:
-
Re: Show customized value in filter pane
Sunny Talwar Oct 24, 2017 7:10 AM (in response to omar bensalem )I am not clear as to what the OP is looking to get... may be a sample of raw data with expected output may help understand better
-
Re: Show customized value in filter pane
siddharth soam Oct 24, 2017 8:45 AM (in response to Sunny Talwar )-
Re: Show customized value in filter pane
Matteo Pietrucci Oct 24, 2017 9:08 AM (in response to siddharth soam)Try this script in a new app; this is the result that you want?:
NoConcatenate
QUARTER:
LOAD
'Q'&ROWNO() AS QUARTER
AutoGenerate 4;
MAP_QUARTER:
LOAD * INLINE [
QUARTER , PREVIOUS
Q2 , Q1
Q3 , Q2
Q3 , Q1
Q4 , Q3
Q4 , Q2
Q4 , Q1
];
In the fillters, you must write this aggregation:
1) =aggr(Only({1<CURRENT-={'Q1'}>}CURRENT),CURRENT)
2) =aggr(Only({1<CURRENT-={'Q1'}>}PREVIOUS),PREVIOUS)
-
-
-
-
Re: Show customized value in filter pane
Mikel Murugarren Añorbe Oct 24, 2017 6:07 AM (in response to siddharth soam)Hi Siddharth soam
I can think of a way to solve your problem, it is in the data file of load, with the functions Previous (when the previous value) and the peek (it returns the value of a record)
In the Script would be something similar to:[Table]:
Load *, If([]=Previous([])+1 ,
PEEK(value)+value,
Resident Table1 ;