Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

how to get amount in last 6 months and last 18 months

i am stuck here for calculating data

From last 24 months have to check data with first 6 months and

for last 6 months based on a date column in format(YYYYMMDD) to first 18 months.

Can you anyone please suggest.

51 Replies
sunny_talwar

I don't think I understand your requirement... but are you checking this WELL, NOT WELL for any specific dimension? Like for example Product wise check if it is WELL or NOT WELL? I suggest you to provide more information as we cannot keep on guessing about what you might need

Anonymous
Not applicable
Author

We are calculating sum of 18 months and 6 months right above.

If sum of 6 months is greater than 18 months i should have value as 'WELL' and if not "NOTWELL" and  should display this also at report beside the values of 6 and 18 months

sunny_talwar

In a text box? In a chart with a dimension or multiple dimensions? You are still not helping us with your description... please provide more info

Anonymous
Not applicable
Author

At report we are showing date,6 months data,18 months data

Now we have add a text column based on 6 and 18 months data and show report as


date,text column,6 months data,18 months data


text column condition will be as If sum of 6 months is greater than 18 months i should have value as 'WELL' and if not "NOTWELL" and  should display this also at report beside the values of 6 and 18 months


is this help full

sunny_talwar

You can try this

Aggr(

if(Sum({<Date = {"$(='>=' & Date(AddMonths(Max(Date), -24)) & '<=' & Date(AddMonths(Max(Date), -6)))"}>}Value)

> Sum({<Date = {"$(='>=' & Date(AddMonths(Max(Date), -5)) & '<=' & Date(AddMonths(Max(Date), 0)))"}>}Value), 'WELL','NOTWELL')

, [Text Column])

Anonymous
Not applicable
Author

getting blank

sunny_talwar

Can you share a sample or at least images of what you are seeing?

Anonymous
Not applicable
Author

i am getting blank

i tried this to use it as a dimension

at report, i am seeing

columns

Date            6monthsdata                        18 monthsdata

20170830    10                                             0

i need to see as

Date               TEXTCOLUMN             6monthsdata                        18 monthsdata

20170830                 WELL                                 10                                             0

But getting as

Date               TEXTCOLUMN             6monthsdata                        18 monthsdata

20170830                                               10                                             0

Aggr(

if(Sum({<Date = {"$(='>=' & Date(AddMonths(Max(Date), -24)) & '<=' & Date(AddMonths(Max(Date), -6)))"}>}Value)

> Sum({<Date = {"$(='>=' & Date(AddMonths(Max(Date), -5)) & '<=' & Date(AddMonths(Max(Date), 0)))"}>}Value), 'WELL','NOTWELL')

, [Text Column])

sunny_talwar

Sorry my friend, I don't think I understand. May be I am not the right person for this. youssefbelloum‌ - Thanks for calling my name out, but I don't think I can help.

Best,

Sunny

YoussefBelloum
Champion
Champion

Thank you anyway Sunny.. Me too I'm done from it.

Good luck bro