cancel
Showing results for 
Search instead for 
Did you mean: 

Previous Month in Webi

Former Member
0 Kudos

Hi Experts,

   I have a data like below,

NameMonthAmount
xxx620000
yyy73000
zzz9400
aaa510000
aaa43200
ccc5100

In prompt, we need to give Month. If user enter month then report should show below details. For example, if user selecting month as 5

Expected Result

Month =5
NameCurrent MonthPrevious Month
aaaa100003200
ccc1000

I need to get name, current month(user selected Month) & Previous Month (5-1). I used < operator in prompt to get previous month data.

In report for previous month column, i used below formula

Previous month = amount where (Month=userresponse("Month:")-1). But am not getting above result. I am getting like below

Available Result

NameCurrent MonthPrevious Month
aaaa10000
3200
ccc100

How to get both the values in same row ?

Accepted Solutions (0)

Answers (2)

Answers (2)

harshil_joshi
Contributor
0 Kudos

Hi,

Hope by using following document you can do it.

Former Member
0 Kudos

Hi,

Create variable for previous month = userresponse("Month:")-1

and new variable for amount= amount in (previous month;name) name is aaa,ccc.

Regards,

Rathish

Former Member
0 Kudos
Name
Current MonthPrevious Month
aaa100003200
3200

     I tried but am not getting expected answer. I got above answer. I need to apply one more logic that, if user entering month 1 and current year then it has to show previous year 12th month value.

Variables -

Selected Month - ToNumber(UserResponse("Enter values for Month:"))

Amount_Previous Month = Amount Where (If [Selected Month]=1 Then [Month]=12 Else [Month]=[Selected Month]-1 And If [Selected Month]=1 Then  [Year]=[Previous Year] Else [Year]=[select year])

I need to remove the second row, could you please help on this?

Former Member
0 Kudos

Hi,

Please try amount= amount in (year;previous month;name) to remove the second row.

Regards,

Rathish