Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
agastya
Creator
Creator

With and without year selection counts are mismatching

Hello Team,

Hope you all doing great!!!!!

Dimension :-  If(Year="2020",Year)

Expression :-

Count(aggr( if((MaxString({<NewFlag_Ignore={'N'}>}DRAWING_REVISION_Number)-MinString({1<NewFlag_Ignore={'N'}>}DRAWING_REVISION_Number))>0,
if((MaxString({<NewFlag_Ignore={'N'}>}DRAWING_REVISION_Number))>(MinString({<NewFlag_Ignore={'N'}>}DRAWING_REVISION_Number)),
(MaxString({<NewFlag_Ignore={'N'}>}DRAWING_REVISION_Number)-MinString({<NewFlag_Ignore={'N'}>}DRAWING_REVISION_Number)),'')),Drawing_Roo_Program_Key))

If i am making year selection i.e 2020 in this case i am getting current count as "349"  

when i am deselecting the Year selection count are mismatching i.e  "103"

Thank you looking for positive reply:)

@sunny_talwar @bharathadde

20 Replies
sunny_talwar

May be try this

Count({<Year = {'2020'}>}Aggr(

If(MaxString({<NewFlag_Ignore = {'N'}, Year = {'2020'}>} DRAWING_REVISION_Number) - MinString({1<NewFlag_Ignore = {'N'}, Year = {'2020'}>} DRAWING_REVISION_Number) > 0,

If(MaxString({<NewFlag_Ignore = {'N'}, Year = {'2020'}>} DRAWING_REVISION_Number) > MinString({<NewFlag_Ignore={'N'}, Year = {'2020'}>} DRAWING_REVISION_Number),

MaxString({<NewFlag_Ignore = {'N'}, Year = {'2020'}>} DRAWING_REVISION_Number) - MinString({<NewFlag_Ignore = {'N'}, Year = {'2020'}>} DRAWING_REVISION_Number), ''))

, Drawing_Roo_Program_Key))

But it seems like this could be converted to this

Sum({<Year = {'2020'}>}Aggr(

RangeMax(MaxString({<NewFlag_Ignore = {'N'}, Year = {'2020'}>} DRAWING_REVISION_Number) - MinString({<NewFlag_Ignore = {'N'}, Year = {'2020'}>} DRAWING_REVISION_Number), 0)

, Drawing_Roo_Program_Key))
agastya
Creator
Creator
Author

Used above range max formula "103" count written with/Without selection year filter @sunny_talwar 

agastya
Creator
Creator
Author

349 value will reflect with/Without selection 

sunny_talwar

How about this?

Count({<Year = {'2020'}>}Aggr(

If(MaxString({<NewFlag_Ignore = {'N'}, Year = {'2020'}>} DRAWING_REVISION_Number) - MinString({1<NewFlag_Ignore = {'N'}, Year = {'2020'}>} DRAWING_REVISION_Number) > 0,

If(MaxString({<NewFlag_Ignore = {'N'}, Year = {'2020'}>} DRAWING_REVISION_Number) > MinString({<NewFlag_Ignore={'N'}, Year = {'2020'}>} DRAWING_REVISION_Number),

MaxString({<NewFlag_Ignore = {'N'}, Year = {'2020'}>} DRAWING_REVISION_Number) - MinString({<NewFlag_Ignore = {'N'}, Year = {'2020'}>} DRAWING_REVISION_Number), ''))

, Drawing_Roo_Program_Key))
agastya
Creator
Creator
Author

Hello ,

 

I tired both the expression unfortunately  no luck 😞

@Sunny 

agastya
Creator
Creator
Author

Issue is that 

(Count({1<Drawing_Roo_Program_Key=p(Drawing_Roo_Program_Key)>} aggr(if(aggr(MaxString({< NewFlag_Ignore={'N'}>}DRAWING_REVISION_Number)-MinString({1< NewFlag_Ignore={'N'}>}DRAWING_REVISION_Number),Drawing_Roo_Program_Key)>0,
if((MaxString({< NewFlag_Ignore={'N'}>}DRAWING_REVISION_Number))>(MinString({< NewFlag_Ignore={'N'}>}DRAWING_REVISION_Number)),
(MaxString({< NewFlag_Ignore={'N'}>}DRAWING_REVISION_Number)-MinString({< NewFlag_Ignore={'N'}>}DRAWING_REVISION_Number)),'')),Drawing_Roo_Program_Key)))

When i am selecting 2020 year filter some of the record which is in 2019,2028

Vis_1-1597134712588.png

expected o/p

Vis_2-1597134770688.png

 

 

 

 

 

sunny_talwar

Some of the records are from 2018 and 2019? But you still want to see them against 2020? Can you elaborate on why are you doing this?

agastya
Creator
Creator
Author

Vis_1-1597143048272.png

 

In the above image selected year is 2020 but couple of Drawing_root_key which is active in 2018 and 2019 as well .

so when i am selecting 2020 year all possible combination will going to consider in 2020 

 

sunny_talwar

Okay so that make sense, I can get you the result when 2020 is selected, but what happens when 2020 is not selected? How would the result look then? Or will you always display this for the most recent year?