Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join this live chat April 6, 10AM EST - QlikView to Qlik Sense REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem with selection

Hello,

For an order-quote analysis, I need to take into consideration the orders that have a quote issued after August 1, 2014, therefore I'm using this script:

Load JD_NDEVIS,

       if(max(date(JD_DATE))>='01/08/2014',1,0) as DATE_OK,

       max(date(JD_DATE)) as JD_DATE_OK

resident Table_suivi_devis

group by JD_NDEVIS;

and in the dimension I use a condtion that ask to show orders (JD_NDEVIS) that have DATE_OK=1 and this is working.

Afterwards, I need to count the amount of quotes issued by orders. Therfore I use this:

if(JD_NVARIANT=(0) and match(JD_INIT_DEV, 'LT', 'HP', 'HW', 'AD', 'FL', 'JR', 'JL', 'FV', 'WL', 'RS', 'LCH', 'LD'),

count ({<JD_INIT_DEV={'LT', 'HP', 'HW', 'AD', 'FL', 'JR', 'JL', 'FV', 'WL', 'RS', 'LCH', 'LD'}>} JD_CODUNIQ),

count ( JD_CODUNIQ))

The first line analize who issued the quote (some person are not to be taken into acount), the second line, count for some people, and the thirs one count for the rest. This also works perfectly.

The only problem is that when I select a year, let say 2013 (that is to say, that some quotes have been issued in 2013 while another one has been issued after August 1, 2014), it only count the amount of quotes that has been issued in 2013, so the one issued in 2014, is not counted.

I tried to add a condition in the count expression like {<JD_DATE_YEAR=>} but then it shows me information for orders that don't even have a quote issued in 2013.

I know it's not easy to understand, but when I select a year, I would like the table to analyze the order that have a quote issued in that year, but taking into consideration all the quotes even the one not issued in tha year

Thanks!!

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Try count({<JD_DATE=, JD_NDEVIS=P(JD_NDEVIS)>}JD_CODUNIQ)


talk is cheap, supply exceeds demand

View solution in original post

5 Replies
Gysbert_Wassenaar

Can you post an example document that demonstrates the problem?


talk is cheap, supply exceeds demand
Not applicable
Author

Here is the qvw file with the sources

Gysbert_Wassenaar

Your document does not contain a field JD_DATE_YEAR.

This expression:

if(JD_NVARIANT=(0) and match(JD_INIT_DEV, 'LT', 'HP', 'HW', 'AD', 'FL', 'JR', 'JL', 'FV', 'WL', 'RS', 'LCH', 'LD'),

count ({<JD_INIT_DEV={'LT', 'HP', 'HW', 'AD', 'FL', 'JR', 'JL', 'FV', 'WL', 'RS', 'LCH', 'LD'}>} JD_CODUNIQ),

count ( JD_CODUNIQ))

does the same as this one:

count (JD_CODUNIQ)


Perhaps what you're looking for is something like:

count ({$*<JD_DATE_YEAR=>}JD_CODUNIQ)


talk is cheap, supply exceeds demand
Not applicable
Author

Hello, so I tried what you wrote, and it doesn't change anything 😕 what does the * mean in front of the set analysis?

So, in theis image, I slected the year 2013 and it shows in the dimension all the orders number that have a quote in 2013. But it also changes the expressions so they are calculated for the year 2013.

probdatesele.png

Let says that for example order n°92526 has two quotes in 2012, two in 2013 and one in 2014. Normally when I select 2013, it should return in the second expression "5", because I have 5 quotes in total for that order. Instead, it retruns me "2" because of two quotes in 2013. 😕

Gysbert_Wassenaar

Try count({<JD_DATE=, JD_NDEVIS=P(JD_NDEVIS)>}JD_CODUNIQ)


talk is cheap, supply exceeds demand

View solution in original post