Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

calculation in load or expression

Hi Guys,

how to get below mentioned output for this input?

  

TicketNumberIDTYPE
1001A
1002B
1003C
1004B
1005E
2001B
2002A
2003E
3001A
3002A
3003E

Output: I'm expecting Ticketnumber 300 records as a output,why because this ticket went through only ticket A & E as type,but ticket number 100 also went through the A & E but also went through some other types (type C in above data)..so I do not need ticket number 100 & 200 (type B in above data so no need) records in my output.

any help will be appreciated

thanks

5 Replies
sunny_talwar

I see what you mean. This is needed on the front end or script?

sunny_talwar

May be this to create Flag and use the flag in set analysis to display only required TicketNumber

Table:

LOAD TicketNumber,

    ID,

    TYPE

FROM

[https://community.qlik.com/thread/214293]

(html, codepage is 1252, embedded labels, table is @1);

Left Join (Table)

LOAD TicketNumber,

  Count(DISTINCT If(not WildMatch(TYPE, 'A', 'E'), TYPE)) as Count,

  If(Count(DISTINCT If(not WildMatch(TYPE, 'A', 'E'), TYPE)) = 0, 1, 0) as Flag

Resident Table

Group By TicketNumber;


Capture.PNG

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

So you want to show only the ticket numbers that only have type A and E. If so try this expression:

count({<TicketNumber=P({<TYPE={'A'}>}TicketNumber)>

            *<TicketNumber=P({<TYPE={'E'}>}TicketNumber)>

            *<TicketNumber=E({<TYPE-={'A','E'}>}TicketNumber)>

          }TicketNumber)


talk is cheap, supply exceeds demand
Not applicable
Author

many thanks sunny,

seems it will work with my real time data as well.

will test it and mark this shortly.

thank u so much.

maxgro
MVP
MVP

Maybe another script solution could be

(keep the record where the distinct concat of TYPE field, order by TYPE, is AE

Table:

LOAD TicketNumber,

     ID,

     TYPE

FROM

[https://community.qlik.com/thread/214293]

(html, codepage is 1252, embedded labels, table is @1);

Right Keep (Table)

LOAD TicketNumber

Where Flag;

LOAD

  TicketNumber,

  Concat(DISTINCT TYPE, '', TYPE) = 'AE' as Flag

Resident Table

Group By TicketNumber;