Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Leverage your QlikView investment to modernize BI – see how! Join Group
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator
Creator

If id present in next year and current year then show else no

hi.

i want to show the sales of customer in the chart only if the customerid exist in current as well as next year otherwise, i want to ignore those ids.

i want to do this in front end...

please help

attached example

Gautham

5 Replies
Highlighted
MVP & Luminary
MVP & Luminary

Re: If id present in next year and current year then show else no

Hi,

Try this.

=sum({<Customerid=p({<Period = {'2015'}>}),Period = {"2016"}>}Sales)

It says give me all the customers of 2015 and then for those customer give me sales of 2016.

Regards,

Kaushik Solanki

Regards,
Kaushik
If reply is satisfactory, please "Like" the post.
If reply is solution, please mark as "Correct".
Highlighted
Creator
Creator

Re: If id present in next year and current year then show else no

Thanks kaushik,

This works for second expression, but for first expression no. I want the sales for customerids which exist in both periods.

please find the attachment..

Highlighted
Creator III
Creator III

Re: If id present in next year and current year then show else no

Hi,


What i understood is an intersection, so you need to add a * in the expression


=sum({<Customerid * =p({<Period = {'2015'}>}),Period = {"2016"}>}Sales)

Highlighted
MVP & Luminary
MVP & Luminary

Re: If id present in next year and current year then show else no

Try this.

Sum({<Id = p({<Year = {"2015"}>})>*<Id = p({<Year = {"2016"}>})>}Sales)

Regards,

Kaushik Solanki

Regards,
Kaushik
If reply is satisfactory, please "Like" the post.
If reply is solution, please mark as "Correct".
Highlighted

Re: If id present in next year and current year then show else no

May be this for a more dynamic expression:

=Sum({<Customerid=p({<Period = {$(=Max(Period))}>})*p({<Period = {$(=Max(Period)+1)}>})>} Sales)