Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
abraham_paradac
Contributor III
Contributor III

How to get an old information from my table

Hi Comunity, I have the follow problem:

 

I Use a Excel File to get contable information from a period, for example:

Month           Should         Have              Balance Currently month     Balance Previous Month

1                          500,0           300,0                         200,0                                                     0

2                          800,0           200,0                        600,0                                                 200

3                         100,0            150,0                         - 50,0                                                 600

 

I need to show this information on a Pivot Table..

When I use a "Normal" Table and get Previous Balance on an external Field with a Set Analisys its Works well.

My set analisys is this: 

If(GetSelectedCount(Month)>=1,if(Month=1, 0, sum({<Month1={$(=Max(Month)-1)}>} ([Should]-([Have])))))

But when  I used this form in a Pivot Table does not Work.

In this Case I decided use a Before Sentence  for get Previous Month . Its works  

Before(SUM([Should]-([Have])))  

But I have a Big problem... When I make a Filter by dimension for example Month This information disapears.

I didn't Know how can I do for use a Pivot Table With Filters Dimensions and Get Previous Balance.

 

I Need Help.

Thanks

2 Solutions

Accepted Solutions
OmarBenSalem

Try useing this measure:

aggr(above(Sum({<Month>}[Balance Currently month])),Month)

 

result:

Capture.PNG

 

if I select Month 2 for example:

Capture.PNG

View solution in original post

OmarBenSalem

Create this new field in the script : 

Capitalize( PurgeChar( month( date#( Month,'M')),'.')) as MonthName

 

and change ur expression from : 

aggr(above(Sum({<Month>}[Balance Currently month])),Month)

 

to

aggr(above(Sum({<Month,MonthName>}[Balance Currently month])),Month)

View solution in original post

8 Replies
OmarBenSalem

Try useing this measure:

aggr(above(Sum({<Month>}[Balance Currently month])),Month)

 

result:

Capture.PNG

 

if I select Month 2 for example:

Capture.PNG

abraham_paradac
Contributor III
Contributor III
Author

Thanks is all I need!

abraham_paradac
Contributor III
Contributor III
Author

I Would like to know How can convert Months Number into Months Char like '1' "Jan", '2' "Feb", '3' "Mar". Because I used Month(MakeDate(Year,Month)) and It Doesn't Work.
Thanks!
OmarBenSalem

Try : 

=month( date#( Month,'M'))

 

And to make it even better : 

 

=Capitalize( Purgechar( month( date#( Month,'M')),'.'))

abraham_paradac
Contributor III
Contributor III
Author

It's Correct my Friend but, when I proceed to convert and I select for example feb. the field 'Previous Balance' Is get in blank "disappeared". How Another idea?

OmarBenSalem

Create this new field in the script : 

Capitalize( PurgeChar( month( date#( Month,'M')),'.')) as MonthName

 

and change ur expression from : 

aggr(above(Sum({<Month>}[Balance Currently month])),Month)

 

to

aggr(above(Sum({<Month,MonthName>}[Balance Currently month])),Month)

abraham_paradac
Contributor III
Contributor III
Author

Look the image and you can understand that I say.

OmarBenSalem

Please... read my last answer carefully and u'll correct this; I have to go !