Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Ignore date selection (dimension field)

Hi,

I need the below expression to ignore my selection in dimension field Date

Cannot get it to work properly for some reason, any suggestions?

//O

=If(sum(SoD_Pmt_amount) <> 0,

If(Above(sum(if(SoD_Pmt_Subtype='Credit line connected payment',SoD_Pmt_amount)),4) = 0,
If(Above(sum(if(SoD_Pmt_Subtype='Credit line connected payment',SoD_Pmt_amount)),3) = 0,
If(Above(sum(if(SoD_Pmt_Subtype='Credit line connected payment',SoD_Pmt_amount)),2) = 0,

If(Above(sum(if(SoD_Pmt_Subtype='Credit line connected payment',SoD_Pmt_amount)),1) = 0,

Above(sum(if(SoD_Pmt_Subtype='Credit line connected payment',SoD_Pmt_amount)),5),
Above(sum(if(SoD_Pmt_Subtype='Credit line connected payment',SoD_Pmt_amount)),1)),
Above(sum(if(SoD_Pmt_Subtype='Credit line connected payment',SoD_Pmt_amount)),1)),
Above(sum(if(SoD_Pmt_Subtype='Credit line connected payment',SoD_Pmt_amount)),1)),

If(Above(sum(if(SoD_Pmt_Subtype='Credit line connected payment',SoD_Pmt_amount)),2) = 0
and
Above(sum(if(SoD_Pmt_Subtype='Credit line connected payment',SoD_Pmt_amount)),1) = 0,

Above(sum(if(SoD_Pmt_Subtype='Credit line connected payment',SoD_Pmt_amount)),3),
Above(sum(if(SoD_Pmt_Subtype='Credit line connected payment',SoD_Pmt_amount)),1))))

1 Solution

Accepted Solutions
sunny_talwar

This is what you can do. Create a variable and call it anything you want. I called it vRange


vRange =

='>=' & If(Sum({<Date = {'$(=Date(AddMonths(Max(Date(Date)),-1)))'}, Pmt_Subtype = {'Credit line connected payment'}, [Year-Month] = >} Pmt_amount) = 0,

If(Sum({<Date = {'$(=Date(AddMonths(Max(Date(Date)),-1)-1))'}, Pmt_Subtype = {'Credit line connected payment'}, [Year-Month] = >} Pmt_amount) = 0,

If(Sum({<Date = {'$(=Date(AddMonths(Max(Date(Date)),-1)-2))'}, Pmt_Subtype = {'Credit line connected payment'}, [Year-Month] = >} Pmt_amount) = 0,

If(Sum({<Date = {'$(=Date(AddMonths(Max(Date(Date)),-1)-3))'}, Pmt_Subtype = {'Credit line connected payment'}, [Year-Month] = >} Pmt_amount) = 0,

Date(AddMonths(Max(Date(Date)),-1)-4), Date(AddMonths(Max(Date(Date)),-1)-3)), Date(AddMonths(Max(Date(Date)),-1)-2)), Date(AddMonths(Max(Date(Date)),-1)-1)),

Date(AddMonths(Max(Date(Date)),-1))) &

'<=' & Max(Date(Date))



And then use these two expressions:

Sum Date

=Sum(if(Pmt_Subtype='Credit line connected payment',Pmt_amount))

Sum Previous Date

=If(Sum({<Date = {'$(vRange)'} , [Year-Month] = >}If(Pmt_Subtype='Credit line connected payment',Pmt_amount)) <> 0, If(Above(Sum({<Date = {'$(vRange)'}, [Year-Month] = >}If(Pmt_Subtype='Credit line connected payment',Pmt_amount)),4) = 0,

If(Above(Sum({<Date = {'$(vRange)'}, [Year-Month] = >}If(Pmt_Subtype='Credit line connected payment',Pmt_amount)),3) = 0, If(Above(Sum({<Date = {'$(vRange)'}, [Year-Month] = >}If(Pmt_Subtype='Credit line connected payment',Pmt_amount)),2) = 0,

If(Above(Sum({<Date = {'$(vRange)'}, [Year-Month] = >}If(Pmt_Subtype='Credit line connected payment',Pmt_amount)),1) = 0, Above(Sum({<Date = {'$(vRange)'}, [Year-Month] = >}If(Pmt_Subtype='Credit line connected payment',Pmt_amount)),5),

Above(Sum({<Date = {'$(vRange)'}, [Year-Month] = >}If(Pmt_Subtype='Credit line connected payment',Pmt_amount)),1)), Above(Sum({<Date = {'$(vRange)'}, [Year-Month] = >}If(Pmt_Subtype='Credit line connected payment',Pmt_amount)),1)),

Above(Sum({<Date = {'$(vRange)'}, [Year-Month] = >}If(Pmt_Subtype='Credit line connected payment',Pmt_amount)),1)), If(Above(Sum({<Date = {'$(vRange)'}, [Year-Month] = >}If(Pmt_Subtype='Credit line connected payment',Pmt_amount)),2) = 0 and

Above(Sum({<Date = {'$(vRange)'}, [Year-Month] = >}If(Pmt_Subtype='Credit line connected payment',Pmt_amount)),1) = 0,

Above(Sum({<Date = {'$(vRange)'}, [Year-Month] = >}If(Pmt_Subtype='Credit line connected payment',Pmt_amount)),3), Above(Sum({<Date = {'$(vRange)'}, [Year-Month] = >}If(Pmt_Subtype='Credit line connected payment',Pmt_amount)),1))))

Output:

HTH

Best,

S

View solution in original post

19 Replies
sunny_talwar

Try and see if this works:

Put {<Date = >} or {<Date = {'*'}>} after Sum everywhere you see Sum

Best,

S

Not applicable
Author

Tried this but getting the very same result.

=If(sum({<Date = >}SoD_Pmt_amount) <> 0,

If(Above(sum({<Date = >}if(SoD_Pmt_Subtype='Credit line connected payment',SoD_Pmt_amount)),4) = 0,
If(Above(sum({<Date = >}if(SoD_Pmt_Subtype='Credit line connected payment',SoD_Pmt_amount)),3) = 0,
If(Above(sum({<Date = >}if(SoD_Pmt_Subtype='Credit line connected payment',SoD_Pmt_amount)),2) = 0,

If(Above(sum({<Date = >}if(SoD_Pmt_Subtype='Credit line connected payment',SoD_Pmt_amount)),1) = 0,

Above(sum({<Date = >}if(SoD_Pmt_Subtype='Credit line connected payment',SoD_Pmt_amount)),5),
Above(sum({<Date = >}if(SoD_Pmt_Subtype='Credit line connected payment',SoD_Pmt_amount)),1)),
Above(sum({<Date = >}if(SoD_Pmt_Subtype='Credit line connected payment',SoD_Pmt_amount)),1)),
Above(sum({<Date = >}if(SoD_Pmt_Subtype='Credit line connected payment',SoD_Pmt_amount)),1)),

If(Above(sum({<Date = >}if(SoD_Pmt_Subtype='Credit line connected payment',SoD_Pmt_amount)),2) = 0
and
Above(sum({<Date = >}if(SoD_Pmt_Subtype='Credit line connected payment',SoD_Pmt_amount)),1) = 0,

Above(sum({<Date = >}if(SoD_Pmt_Subtype='Credit line connected payment',SoD_Pmt_amount)),3),
Above(sum({<Date = >}if(SoD_Pmt_Subtype='Credit line connected payment',SoD_Pmt_amount
)),1))))

sunny_talwar

Tested on our previous post's expression and it works:


Sum Previous Date

=If(Sum({<Date = >}if(Pmt_Subtype='Credit line connected payment',Pmt_amount)) <> 0, If(Above(Sum({<Date = >}if(Pmt_Subtype='Credit line connected payment',Pmt_amount)),4) = 0,

If(Above(Sum({<Date = >}if(Pmt_Subtype='Credit line connected payment',Pmt_amount)),3) = 0, If(Above(Sum({<Date = >}if(Pmt_Subtype='Credit line connected payment',Pmt_amount)),2) = 0,

If(Above(Sum({<Date = >}if(Pmt_Subtype='Credit line connected payment',Pmt_amount)),1) = 0, Above(Sum({<Date = >}if(Pmt_Subtype='Credit line connected payment',Pmt_amount)),5),

Above(Sum({<Date = >}if(Pmt_Subtype='Credit line connected payment',Pmt_amount)),1)), Above(Sum({<Date = >}if(Pmt_Subtype='Credit line connected payment',Pmt_amount)),1)),

Above(Sum({<Date = >}if(Pmt_Subtype='Credit line connected payment',Pmt_amount)),1)), If(Above(Sum({<Date = >}if(Pmt_Subtype='Credit line connected payment',Pmt_amount)),2) = 0 and

Above(Sum({<Date = >}if(Pmt_Subtype='Credit line connected payment',Pmt_amount)),1) = 0,

Above(Sum({<Date = >}if(Pmt_Subtype='Credit line connected payment',Pmt_amount)),3), Above(Sum({<Date = >}if(Pmt_Subtype='Credit line connected payment',Pmt_amount)),1))))

Sum Date

=sum({<Date = >}if(Pmt_Subtype='Credit line connected payment',Pmt_amount))

Best,

S

sunny_talwar

Take at the application, may be you can figure out the difference. PFA

Best,

S

Not applicable
Author

problem occurs for the first date when you select a specific month. Pls see below:

Capture.JPG


sunny_talwar

So the thing to note here is that by putting in {<Date = >} you are telling the expression not to change based on any selection in Date listbox. In your case you made a selection on Month-Year list box which will not stop the expression to change. To tell the expression not to change on Date and Month-Year selections you would put this:


{<Date = , Month-Year = >}



So now if there are any other fields that you don't want your expression to change on, put them there in your set analysis modifier.

This below expressions won't change on any selection in Date and Month-Year listbox

Sum Previous Date

=If(Sum({<Date = , [Year-Month] = >}if(Pmt_Subtype='Credit line connected payment',Pmt_amount)) <> 0, If(Above(Sum({<Date = , [Year-Month] = >}if(Pmt_Subtype='Credit line connected payment',Pmt_amount)),4) = 0,

If(Above(Sum({<Date = , [Year-Month] = >}if(Pmt_Subtype='Credit line connected payment',Pmt_amount)),3) = 0, If(Above(Sum({<Date = , [Year-Month] = >}if(Pmt_Subtype='Credit line connected payment',Pmt_amount)),2) = 0,

If(Above(Sum({<Date = , [Year-Month] = >}if(Pmt_Subtype='Credit line connected payment',Pmt_amount)),1) = 0, Above(Sum({<Date = , [Year-Month] = >}if(Pmt_Subtype='Credit line connected payment',Pmt_amount)),5),

Above(Sum({<Date = , [Year-Month] = >}if(Pmt_Subtype='Credit line connected payment',Pmt_amount)),1)), Above(Sum({<Date = , [Year-Month] = >}if(Pmt_Subtype='Credit line connected payment',Pmt_amount)),1)),

Above(Sum({<Date = , [Year-Month] = >}if(Pmt_Subtype='Credit line connected payment',Pmt_amount)),1)), If(Above(Sum({<Date = , [Year-Month] = >}if(Pmt_Subtype='Credit line connected payment',Pmt_amount)),2) = 0 and

Above(Sum({<Date = , [Year-Month] = >}if(Pmt_Subtype='Credit line connected payment',Pmt_amount)),1) = 0,

Above(Sum({<Date = , [Year-Month] = >}if(Pmt_Subtype='Credit line connected payment',Pmt_amount)),3), Above(Sum({<Date = , [Year-Month] = >}if(Pmt_Subtype='Credit line connected payment',Pmt_amount)),1))))

Sum Date

=Sum({<Date = , [Year-Month] = >}if(Pmt_Subtype='Credit line connected payment',Pmt_amount))

Output:

Value for 2014/11/28 Sum Previous Date is blank because the data starts from 2014/11/28, so there is no previous date value to display (i.e., 2014/11/27 value)

HTH

Best,

S

Not applicable
Author

Aaa, I see that explains.

In my case im generating a report for every month so I just wanna see the december dates.

Is there a way of just showing the selected month? For instance if I select December-2014 I wanna see all of the december dates only, but with the calculations intact, meaning that I wanna see the prev date sum för 1-dec too


Not applicable
Author

I wanna select December and see the below Only, no novermber dates.

Capture.JPG


sunny_talwar

Yes there is a way to do that. I am working on it and will respond when I have the solution for you.

Best,

S